stevell Posted August 30, 2013 Share Posted August 30, 2013 I have checked the log file on my sites and they have regular error logs virtually every day with this same message, *ERROR* 2013/08/30 - 21:06:20: Invalid product vars at line 108 in file classes/Link.php Below is the relevant snippet from Link.php 100 if (!is_object($product)) 102 { 103 if (is_array($product) && isset($product['id_product'])) 104 $product = new Product($product['id_product'], false, $id_lang); 105 else if (is_numeric($product) || !$product) 106 $product = new Product($product, false, $id_lang); 107 else 108 throw new PrestaShopException('Invalid product vars'); 109 } Any suggestions on the cause of these errors? Steve Link to comment Share on other sites More sharing options...
El Patron Posted August 31, 2013 Share Posted August 31, 2013 change else if (is_numeric($product) || !$product) to elseif ((int)$product) Link to comment Share on other sites More sharing options...
west28 Posted December 10, 2013 Share Posted December 10, 2013 Work's on Ps 1.5.4.1 Thank's Link to comment Share on other sites More sharing options...
Alberto Fernández Posted September 9, 2014 Share Posted September 9, 2014 (edited) change else if (is_numeric($product) || !$product) to elseif ((int)$product) I got the same problem after updating a product today, but in my case this fix really exist in classes/link.php, what can I do?: 98. if (is_array($product) && isset($product['id_product'])) 99. $product = new Product($product['id_product'], false, $id_lang, $id_shop); 100. elseif ((int)$product) 101. $product = new Product((int)$product, false, $id_lang, $id_shop); 102. else 103. throw new PrestaShopException('Invalid product vars'); 104. } 105. 106. // Set available keywords 107. $params = array(); 108. $params['id'] = $product->id; Any idea? Using 1.5.6.1 Edited September 9, 2014 by Alberto Fernández (see edit history) Link to comment Share on other sites More sharing options...
Alberto Fernández Posted September 9, 2014 Share Posted September 9, 2014 I reply myself. Just I had to read again more carefully the debugging messages: LinkCore->getProductLink - [line 53 - cache/smarty/compile/16/00/d5/1600d59fbd3289c267e5b8f2c813bbb7927bb1ac.file.crossselling.tpl.php] So I deactivated the module crosselling, recently updated. 1 Link to comment Share on other sites More sharing options...
ventesites Posted September 30, 2014 Share Posted September 30, 2014 I am having the same exact problem, did removing crosseling solved it? Link to comment Share on other sites More sharing options...
ThreeWest Posted December 11, 2014 Share Posted December 11, 2014 Just updated the crosselling module today and sure enough, I'm getting these errors now. ugh! Link to comment Share on other sites More sharing options...
cille5 Posted March 2, 2015 Share Posted March 2, 2015 Did you find solution? Link to comment Share on other sites More sharing options...
Gipielle Posted April 10, 2015 Share Posted April 10, 2015 Same problem with PS 1.5.6.1, when in BO try to view a customer from a cart Link to comment Share on other sites More sharing options...
Gipielle Posted April 10, 2015 Share Posted April 10, 2015 Solved with this: https://github.com/PrestaShop/PrestaShop/commit/8e506ddff20568c21e3d99c583a28bb7ad41d7da Link to comment Share on other sites More sharing options...
ventesites Posted June 14, 2015 Share Posted June 14, 2015 this is NOT solved at all, the bug update suggested by Gipielle is from 2013 and the problem is NOW with presta 1.6. Link to comment Share on other sites More sharing options...
Gipielle Posted June 15, 2015 Share Posted June 15, 2015 Unfortunately prestashop it works that way ... They prefer to do new functions all the time rather than solve problems. Link to comment Share on other sites More sharing options...
sapaypape Posted July 30, 2015 Share Posted July 30, 2015 I have the same problem and my shop doesn't work... could you solved that? Link to comment Share on other sites More sharing options...
Tibo S. Posted August 24, 2015 Share Posted August 24, 2015 Hi, I'm on 1.6.0.14 and i get the same problem. Anybody have found a solution? Link to comment Share on other sites More sharing options...
bhawin91 Posted October 21, 2015 Share Posted October 21, 2015 (edited) anybody found the solution , my website is http://dev.sparklemuse.com/mobile/index.php?controller=order LinkCore->getProductLink - [line 1227 - cache/smarty/compile/c9/76/69/c97669328fc51d105e43c4d3a604c5451528ecf0.file.shopping-cart.tpl.php] - [8 Arguments] Edited October 21, 2015 by bhawin91 (see edit history) Link to comment Share on other sites More sharing options...
chamadalhoum Posted September 27, 2016 Share Posted September 27, 2016 Constant errors, Invalid product vars at line 108 in file classes/Link.php [PrestaShopException] Invalid product vars at line 106 in file classes/Link.php 101. if (is_array($product) && isset($product['id_product'])) {102. $product = new Product($product['id_product'], false, $id_lang, $id_shop); 103. } elseif ((int)$product) { 104. $product = new Product((int)$product, false, $id_lang, $id_shop); 105. } else { 106. throw new PrestaShopException('Invalid product vars'); 107. } 108. } 109. 110. // Set available keywords 111. $params = array(); LinkCore->getProductLink - [line 51 - cache/smarty/compile/fa/a7/d3/faa7d3f1ce3070eb8e195cca0cd07a1a6fded006.file.script.tpl.php] - [2 Arguments] content_57e9afad31f573_04644155 - [line 188 - tools/smarty/sysplugins/smarty_internal_templatebase.php] - [1 Arguments] Smarty_Internal_TemplateBase->fetch - [line 317 - classes/SmartyCustom.php] - [7 Arguments] Smarty_Custom_Template->fetch - [line 2309 - classes/module/Module.php] ModuleCore->display - [line 220 - modules/up2social/up2social.php] - [2 Arguments] up2social->hookFooter - [line 587 - classes/Hook.php] - [1 Arguments] HookCore::coreCallHook - [line 544 - classes/Hook.php] - [3 Arguments] HookCore::exec - [line 1022 - classes/controller/FrontController.php] - [1 Arguments] FrontControllerCore->initFooter - [line 195 - classes/controller/Controller.php] ControllerCore->run - [line 367 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 5 - index.php] Link to comment Share on other sites More sharing options...
Berty Posted April 3, 2017 Share Posted April 3, 2017 I had the same problem... If the Cross-selling module is deactivated, you must disable the "Show cross-selling" option in the BlockCart module! By doing this, on my site the bug has disappeared. 2 Link to comment Share on other sites More sharing options...
Recommended Posts