Funny-Cat WebShop Posted August 22, 2014 Share Posted August 22, 2014 (edited) I recently (finally) upgraded from Prestashop 1.4.10 to Prestashop 1.6.0.9, all is tweaked fine and running well except for one error that keeps showing up on the error_log everytime after I edit a product. PHP Notice: Undefined index: languages in /var/www/vhosts/DOMAIN.TLD/httpdocs/prestashop/cache/smarty/compile/d2/83/84/d28384ab6b1742618843bc582a07f28f04a39f8e.file.features.tpl.php on line 242, referer: https://www.DOMAIN.TLD/admin-CONFIDENTIAL/index.php?controller=AdminProducts&id_product=7777&updateproduct&token=TOKEN PHP Notice: Trying to get property of non-object in /var/www/vhosts/DOMAIN.TLD/httpdocs/prestashop/cache/smarty/compile/d2/83/84/d28384ab6b1742618843bc582a07f28f04a39f8e.file.features.tpl.php on line 242, referer: https://www.DOMAIN.TLD/admin-CONFIDENTIAL/index.php?controller=AdminProducts&id_product=7777&updateproduct&token=TOKEN PHP Notice: Undefined index: languages in /var/www/vhosts/DOMAIN.TLD/httpdocs/prestashop/cache/smarty/compile/d2/83/84/d28384ab6b1742618843bc582a07f28f04a39f8e.file.features.tpl.php on line 262, referer: https://www.DOMAIN.TLD/admin-CONFIDENTIAL/index.php?controller=AdminProducts&id_product=7777&updateproduct&token=TOKEN PHP Notice: Trying to get property of non-object in /var/www/vhosts/DOMAIN.TLD/httpdocs/prestashop/cache/smarty/compile/d2/83/84/d28384ab6b1742618843bc582a07f28f04a39f8e.file.features.tpl.php on line 262, referer: https://www.DOMAIN.TLD/admin-CONFIDENTIAL/index.php?controller=AdminProducts&id_product=7777&updateproduct&token=TOKEN The database engine was still MyIsam and I changed to InnoDB this morning but the error persists.FILE INFOd28384ab6b1742618843bc582a07f28f04a39f8e.file.features.tpl.phpLine 242: $_from = $_smarty_tpl->tpl_vars['languages']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}Line 262: $_from = $_smarty_tpl->tpl_vars['languages']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');} Any ideias? Edited August 22, 2014 by Funny-Cat WebShop (see edit history) Link to comment Share on other sites More sharing options...
BluTiGeS Posted October 20, 2014 Share Posted October 20, 2014 (edited) I am seeing the same problem anyone saw this behaviour? The funny thing is if I activate the debug mode in the defines.php the error is gone. Any idea? SyntaxError: missing ; before statementNotice: Undefined index: languages in /cache/smarty/compile Edited October 20, 2014 by BluTiGeS (see edit history) Link to comment Share on other sites More sharing options...
Alexandru Trandafir Posted January 10, 2015 Share Posted January 10, 2015 I have no idea why this bug happend, because at first we could add products with no problem then after a while when creating a new product we got the same undefined index error. I have solved it this way in case it helpes someone else: Opened: /<admin-folder>/themes/default/template/controllers/products/features.tpl You will see at the beginning there's a check for product ID: {if isset($product->id)} That ends before some javascript code: {/if} <script type="text/javascript"> hideOtherLanguage({$default_form_language}); {literal} $(".textarea-autosize").autosize(); function all_languages(pos) { {/literal} {foreach from=$languages key=k item=language} The solution is to move the {/if} that is before the javascript code to the end of the file: </script> {/literal} {/if} Or better said, to include the javascript code inside the condition that checks if there's a product id. Link to comment Share on other sites More sharing options...
Naoto Posted January 11, 2015 Share Posted January 11, 2015 Thank you, Alexandru. Your suggestion works for me. I hate to those warnings in the log, and they are gone now. But importantly I guess my PrestaShop was ignoring languages which I need in the future. Link to comment Share on other sites More sharing options...
vekia Posted January 11, 2015 Share Posted January 11, 2015 it shows in your back office ? Link to comment Share on other sites More sharing options...
Naoto Posted January 12, 2015 Share Posted January 12, 2015 vekia, No, I do not think so. Alexandru wrote he found in error_log, and so did I. Link to comment Share on other sites More sharing options...
Recommended Posts