Jump to content

Notice: Undefined offset ERROR


AFemaleProdigy

Recommended Posts

I just got this error during checkout on my website.  I have not seen this before.  Any ideas?

Notice: Undefined offset: 19867 in /home/rotmgvaultgames/public_html/classes/stock/StockManager.php on line 836
[PrestaShopDatabaseException]

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 ') GROUP BY s.`id_product` LIMIT 1' at line 5

SELECT SUM(s.`usable_quantity`) as quantity
						FROM ps_stock s
						LEFT JOIN ps_warehouse_carrier wc ON wc.`id_warehouse` = s.`id_warehouse`
						LEFT JOIN ps_carrier c ON wc.`id_carrier` = c.`id_reference`
						WHERE s.`id_product` = 397 AND s.`id_product_attribute` = 0 AND s.`id_warehouse` = 1 AND c.`id_carrier` IN () GROUP BY s.`id_product` LIMIT 1


at line 791 in file classes/db/Db.php

786.         if ($webservice_call && $errno) {
787.             $dbg = debug_backtrace();
788.             WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
789.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
790.             if ($sql) {
791.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
792.             }
793. 
794.             throw new PrestaShopDatabaseException($this->getMsgError());
795.         }
796.     }

Link to comment
Share on other sites

Why in IN condition you haven't got any value?

 

Add some value to test example IN(1) and check if exists error or remove this contition

SELECT SUM(s.`usable_quantity`) as quantity
						FROM ps_stock s
						LEFT JOIN ps_warehouse_carrier wc ON wc.`id_warehouse` = s.`id_warehouse`
						LEFT JOIN ps_carrier c ON wc.`id_carrier` = c.`id_reference`
						WHERE s.`id_product` = 397 AND s.`id_product_attribute` = 0 AND s.`id_warehouse` = 1 AND c.`id_carrier` IN (1) GROUP BY s.`id_product` LIMIT 1
Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...