Jump to content

log error


foz1234

Recommended Posts

hi just wondered what this error was if anyone can help, takne from admin error log?

File: [cubecart.class.php] Line: [97] "SELECT I.* FROM `CubeCart_inventory` AS I JOIN `CubeCart_category` AS C ON C.cat_id=I.cat_id AND C.`status`=1 AND ORDER BY I.date_added DESC, I.product_id DESC LIMIT 9" - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY I.date_added DESC, I.product_id DESC LIMIT 9' at line 1

thanks

Edited by foz1234
Link to comment
Share on other sites

lines 95-99

  if ($GLOBALS['config']->get('config', 'catalogue_latest_products')) {
   $query = sprintf("SELECT I.* FROM `%1\$sCubeCart_inventory` AS I JOIN `%1\$sCubeCart_category` AS C ON C.cat_id=I.cat_id AND C.`status`=1 AND $where ORDER BY I.date_added DESC, I.product_id DESC", $GLOBALS['config']->get('config', 'dbprefix'));
   $latestProducts = $GLOBALS['db']->query($query, (int)$GLOBALS['config']->get('config', 'catalogue_latest_products_count'));
   if ($latestProducts) {
    foreach ($latestProducts as $product) {

was this something to do with a security issue that i had to put the cubecart.class.php from 6.1.3 into 6.1.1 save updating from memory but memory is not what it used to be lol.

shall i just upload the cubecart.class.php from 6.1.1 ?

i want to get on to the latest version asap but seeing the problems people were having recently i hung back

should i be able to cpanel upgrade from 6.1.1 to 6.1.6 without many problems?

thanks again Brian

Edited by foz1234
Link to comment
Share on other sites

what would you suggest Brian?

i have compared the working catalogue.class.php to one from stock 6.1.1 file and they match no edits 

may not be related but looking back through the logs it happed around the time i edited this

https://github.com/cubecart/v6/commit/8f1ec4e87c58e60e7fd865eabc6a1ab2b721729c

 

Edited by foz1234
Link to comment
Share on other sites

In admin, enable debug mode. Store Settings, Advanced tab, Enable debug, and then enter your IP address in the adjacent field (www.whatismyip.com).

In cubecart.class.php:

Near line 93, find:

$where = $GLOBALS['catalogue']->outOfStockWhere(array('I.status' => '1', 'I.latest' => '1'), 'I');

On a blank line after that add:

$GLOBALS['debug']->debugMessage("Out of Stock Where is: ".$where);

Get the Homepage of your site (has the Latest Products).

At the bottom of the page, there will be a grey section. In this section will be Debug Messages.

Let us know what, if anything, is showing for the Out of Stock query expression.

If there isn't anything here, we will then look at the Catalogue class.

Link to comment
Share on other sites

Hi Brian

thank you for your help mate

followed the above instructions and i get  

Debug Messages:
 [0] Out of Stock Where is:

Memory: Peak Usage / Max (%):
2.46MB / 128M (1.92%)
Cache (File): Enabled
Cache Used: 0.58 KB of 475.56 KB (0.12%) [Clear Cache]
Page Load Time:
0.212754 seconds

I've pm'ed you the full debug mate

Edited by foz1234
Link to comment
Share on other sites

Ok, so nothing is coming back from the Catalogue function.

In catalogue.class.php:

Near line 1421, find:

public function outOfStockWhere($original = false, $label = false, $force = false) {

  $def = $original ? str_replace('WHERE ', '', $GLOBALS['db']->where('CubeCart_inventory', $original, $label)) : '';

On a blank line after that, add:

$GLOBALS['debug']->debugMessage("The def value is: ".$def);

Let's see what that gets us.

Link to comment
Share on other sites

I have put back the two manual patches that were suggested by al from the upgrades 6.1.2 & 6.1.4 back to the standard 6.1.1 files and it seems to have cured the problem. As yet no errors have shown in either log so i will continue to test for the next few hours then look to upgrade.

I believe 6.1.7 is imminent ? so i may hang fire on the upgrade if this is the case?

once again Brian thank you for your time and experienced guidance with my issue.

 

Link to comment
Share on other sites

i may have spoken to soon, i now get a different error

File: [catalogue.class.php] Line: [1715] "SELECT I.* FROM CubeCart_inventory AS I LEFT JOIN (SELECT product_id, MAX(price) as price, MAX(sale_price) as sale_price FROM CubeCart_pricing_group WHERE group_id = 0 GROUP BY product_id) as G ON G.product_id = I.product_id WHERE I.product_id IN (SELECT product_id FROM `CubeCart_category_index` as CI INNER JOIN CubeCart_category as C where CI.cat_id = C.cat_id AND C.status = 1) AND I.status = 1 AND (I.name fulltext '%t8%' OR I.description fulltext '%t8%' OR I.product_code fulltext '%t8%') LIMIT 12 OFFSET 0 " - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext '%t8%' OR I.description fulltext '%t8%' OR I.product_code fulltext '%t8' at line 1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...