Aldeag Posted December 15, 2011 Share Posted December 15, 2011 I use Prestashop 1.4.5.1 and after upgrading from 1.3.6 I see many bugs. But this topic is only to question about the use of Smarty. I don´t know nothing about programming. I suppoussed that 1.4.5.1 was going to be compatible with Smarty 3 as Presta 1.5 I think will only work with Smarty 3 But if I check to use Smarty 3 instead of 2 I get this problem in the main page of the Front Office: Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/menu_tree.tpl" on line 23 "{foreach from=$item.childrens item=item name=menuTreeChildrens}" item variable 'item' may not be the same variable as at 'from'' in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:431 Stack trace: #0 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_compile_foreach.php(40): Smarty_Internal_TemplateCompilerBase->trigger_template_error('item variable '...', 23) #1 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php(284): Smarty_Internal_Compile_Foreach->compile(Array, Object(Smarty_Internal_SmartyTemplateCompiler), Array, NULL, NULL) #2 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_template in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 431 So I have to use Smarty 2 Is it normal? Link to comment Share on other sites More sharing options...
Scotty501 Posted December 15, 2011 Share Posted December 15, 2011 Sounds like your theme may not be smarty 3 compatible (as a novice I am making a quick guess) - but looking at your site you have used the default theme? I guess you have switched it until you find the fix - which theme are you having the problem with? You can check your theme here http://validator.prestashop.com/?page=guide If you theme fails to validate - then Yes it is normal to only work with Smarty 2. You should consider updating the theme or making a new one to Smarty 3 standards as Prestashop is moving on with Smarty 3 and you will have further issues when you upgrade in the future. Link to comment Share on other sites More sharing options...
Aldeag Posted December 15, 2011 Author Share Posted December 15, 2011 It is the standar Prestashop theme. Not even the new standar one. Link to comment Share on other sites More sharing options...
doekia Posted December 15, 2011 Share Posted December 15, 2011 Yes smarty syntax has evolved between version 2 to 3. In order to make templates within your theme compatable with smarty3, it usually suffise to adapt the syntax in include and assign Example: {include file=$tpl_dir./scenes.tpl scenes=$scenes} Should be converted to: {include file="$tpl_dir./scenes.tpl" scenes=$scenes} Also, you should not forget to copy thoses new templates that did not exists prior 1.4, which is the case weither you use smarty v2 or v3: product-compare.tpl products-comparison.tpl store_infos.tpl store.tpl order-opc-new-account.tpl restricted-country.tpl guest-tracking.tpl category-cms-tree-branch.tpl order-opc.tpl It worth also taking some time to convert product.tpl so it take care of the new tax rules and catalog mode. Best, (d)oekia 1 Link to comment Share on other sites More sharing options...
theme_designer Posted December 16, 2011 Share Posted December 16, 2011 I recommend you to install a fresh prestashop 1.4.5. Upgrading offen occurs problems. Link to comment Share on other sites More sharing options...
doekia Posted December 16, 2011 Share Posted December 16, 2011 I recommend you to install a fresh prestashop 1.4.5. Upgrading offen occurs problems. A totallly false statement. I have upgraded hundreds of shop with not a single problem. When problem occurs they are related to core/database mod or theme inconsistencies Link to comment Share on other sites More sharing options...
Aldeag Posted December 20, 2011 Author Share Posted December 20, 2011 I quote my self. Seems that at least jbx_menu is not compatible with smarty 3. Or am I wrong? I use Prestashop 1.4.5.1 and after upgrading from 1.3.6 I see many bugs. But this topic is only to question about the use of Smarty. I don´t know nothing about programming. I suppoussed that 1.4.5.1 was going to be compatible with Smarty 3 as Presta 1.5 I think will only work with Smarty 3 But if I check to use Smarty 3 instead of 2 I get this problem in the main page of the Front Office: Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/menu_tree.tpl" on line 23 "{foreach from=$item.childrens item=item name=menuTreeChildrens}" item variable 'item' may not be the same variable as at 'from'' in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:431 Stack trace: #0 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_compile_foreach.php(40): Smarty_Internal_TemplateCompilerBase->trigger_template_error('item variable '...', 23) #1 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php(284): Smarty_Internal_Compile_Foreach->compile(Array, Object(Smarty_Internal_SmartyTemplateCompiler), Array, NULL, NULL) #2 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_template in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 431 So I have to use Smarty 2 Is it normal? Link to comment Share on other sites More sharing options...
doekia Posted December 20, 2011 Share Posted December 20, 2011 tweak a bit the syntax I think {foreach from=${item.childrens} item=item name=menuTreeChildrens} will do Link to comment Share on other sites More sharing options...
Aldeag Posted December 20, 2011 Author Share Posted December 20, 2011 Where should I change that? Link to comment Share on other sites More sharing options...
doekia Posted December 20, 2011 Share Posted December 20, 2011 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/menu_tree.tpl" on line 23 Link to comment Share on other sites More sharing options...
Aldeag Posted December 21, 2011 Author Share Posted December 21, 2011 tweak a bit the syntax I think {foreach from=${item.childrens} item=item name=menuTreeChildrens} will do Should I find that line, delete it, substitute for other? What? I don´t know much about programming. Maybe others reading this know less than me. Can you be more explicit? Thanks!! Link to comment Share on other sites More sharing options...
doekia Posted December 21, 2011 Share Posted December 21, 2011 mode: !!! In your file /modules/jbx_menu/menu_tree.tpl you have this line: {foreach from=$item.childrens item=item name=menuTreeChildrens} try to replace it with this: {foreach from=${item.childrens} item=item name=menuTreeChildrens} Clear your smarty cache, test Link to comment Share on other sites More sharing options...
Aldeag Posted December 21, 2011 Author Share Posted December 21, 2011 mode: !!! In your file /modules/jbx_menu/menu_tree.tpl you have this line: {foreach from=$item.childrens item=item name=menuTreeChildrens} try to replace it with this: {foreach from=${item.childrens} item=item name=menuTreeChildrens} Done! Clear your smarty cache, test How I do that? Link to comment Share on other sites More sharing options...
doekia Posted December 21, 2011 Share Posted December 21, 2011 empty the directory tools/smarty/compile but the index.php if it exists could be smarty_v2 depending on your config Link to comment Share on other sites More sharing options...
Aldeag Posted December 21, 2011 Author Share Posted December 21, 2011 Empty both. Module enabled and in front office I see a white page with this message: Notice: Undefined variable: title in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/menu.class.php on line 265 Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/menu_tree.tpl" on line 23 "{foreach from=${item.childrens} item=item name=menuTreeChildrens}" - Unexpected "."' in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:431 Stack trace: #0 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templateparser.php(2855): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templateparser.php(2920): Smarty_Internal_Templateparser->yy_syntax_error(56, '.') #2 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(51): Smarty_Internal_Templateparser->doParse(56, '.') #3 /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tienda in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 431 Link to comment Share on other sites More sharing options...
doekia Posted December 21, 2011 Share Posted December 21, 2011 Let me check the correct syntax... Link to comment Share on other sites More sharing options...
doekia Posted December 21, 2011 Share Posted December 21, 2011 Question is this version of the jbx_menu a legal one? If yes, you may consider upgrading to latest version which correct the error. Since this a free licensed module, the correction is this: In your file /modules/jbx_menu/menu_tree.tpl you have this line: {foreach from=$item.childrens item=item name=menuTreeChildrens} try to replace it with this: {foreach from={$item.childrens} item=item name=menuTreeChildrens} Link to comment Share on other sites More sharing options...
Aldeag Posted December 21, 2011 Author Share Posted December 21, 2011 Now I see my page, but I get this message on top of the page. Notice: Undefined variable: title in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/menu.class.php on line 265 The menú is empty. It doesn´t saved my settings And it is the original. Version 2.6.4 I imported the module from my last update. It was Prestashop 1.4.5.1 Maybe I have to import some other settings Link to comment Share on other sites More sharing options...
doekia Posted December 21, 2011 Share Posted December 21, 2011 Current level of this modules is 2.8.4 http://www.julien-br...enu-horizontal/ And if it doesn't save the settings you probably have permission restriction in the directory where this module get installed. Link to comment Share on other sites More sharing options...
Aldeag Posted December 21, 2011 Author Share Posted December 21, 2011 Updated to JBX Menu 2.8.4 I get this message on top of my page: Warning: Invalid argument supplied for foreach() in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/menu.class.php on line 183 Link to comment Share on other sites More sharing options...
doekia Posted December 21, 2011 Share Posted December 21, 2011 Ok, edit the file /modules/jbx_menu/menu.class.php add a line betwwen 182 and 183, type in the following code: if (!isset($results) || !is_array($results)) $results = array(); Then report the bug to Julien Link to comment Share on other sites More sharing options...
Aldeag Posted December 22, 2011 Author Share Posted December 22, 2011 Ok, edit the file /modules/jbx_menu/menu.class.php add a line betwwen 182 and 183, type in the following code: if (!isset($results) || !is_array($results)) $results = array(); Then report the bug to Julien With that line added I don´t see the error message, but I don´t see the jbx_menu either. It dissapears. I will report Julien. Link to comment Share on other sites More sharing options...
doekia Posted December 22, 2011 Share Posted December 22, 2011 Odd. A question, do you have come content in the menu? tent to remember you have to configure it first. Link to comment Share on other sites More sharing options...
Aldeag Posted December 22, 2011 Author Share Posted December 22, 2011 There is no way to add any item in the menu. I add items and save. It says OK but it is always empty. Link to comment Share on other sites More sharing options...
doekia Posted December 22, 2011 Share Posted December 22, 2011 Did you checked your permissions as I asked before? /modules/jbx_menu ?? Link to comment Share on other sites More sharing options...
Aldeag Posted December 23, 2011 Author Share Posted December 23, 2011 They are 777 recursively. Keeps the same. Link to comment Share on other sites More sharing options...
doekia Posted December 23, 2011 Share Posted December 23, 2011 That is pretty odd because I just take the jbx_menu 2.8.4 , pristine, it runs like a charm on all my different PS. And on my staging system I have some setting that trap on any coding errors, and it went silent. You mention 777? Is this on a hosting service? Sometimes 777 is not allowed (ie OVH forbid this use - max perm is 707 group should always be clean). In case, uninstall the module, physically remove it, clear your cache (server). How did you installed it by the way? Thru the panel directly or FTP? Usually I prefer panel mode even doo that is not quite good some times. Try reinstall then. Hope this time we will go somewhere. Link to comment Share on other sites More sharing options...
Aldeag Posted December 23, 2011 Author Share Posted December 23, 2011 I delete the module with my FTP (Cyberduck on a Mac) and the changes we made inside in /modules/jbx_menu/menu.class.php Emptyed cache Uploaded module again with Cyberduck. Set permisions to 777 (Owner, Group and Others can read, write and execute) recursively. In the back office I get this error Warning: file_put_contents(/var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/config.xml) [function.file-put-contents]: failed to open stream: Permission denied in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Module.php on line 1114 In the front office I get this on top of my page: Warning: Invalid argument supplied for foreach() in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/menu.class.php on line 183 If I add the line you comment if (!isset($results) || !is_array($results)) $results = array(); I get the same problems: error line on top dissapears and JBX menu dissapears also. If I delete the line, the menu appears and the error message also appears If I want to add items inside the module it says "Upgrade succesfull", but the menu keeps empty... I only see one object named "Link" but no other adds I deleted that object and the message is: Deletion successful List of Objets Your menu is full!! Link to comment Share on other sites More sharing options...
doekia Posted December 23, 2011 Share Posted December 23, 2011 Warning: file_put_contents(/var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/jbx_menu/config.xml) [function.file-put-contents]: failed to open stream: Permission denied in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Module.php on line 1114 Yes a permission problem. Set write permissions recursively for the module dir (for all dir within modules btw) Under a SSH terminal you can do such by chmod -R a+w <directory-holding-modules> Once the permissions fixed, from the BO, uninstall / reinstall the module (reset) BTW, 777 is for directories, while for files it is 666 Link to comment Share on other sites More sharing options...
Aldeag Posted December 23, 2011 Author Share Posted December 23, 2011 But in the instructions for installing/upgrading I can read: If not, make sure that the folders' rights are properly configured: change the access rights of the folders marked in red in the install/update tool, directly on your FTP server (make a CHMOD 755 or 775, depending on your hosting provider) then click the "Refresh these settings" button. In order to perform a CHMOD, using your FTP client, find the folders that have the wrong permission settings, right-click on each of them in order to display their properties (or even better, their access rights), and tick the boxes that are not yet ticked, until a refresh of the "System and Permissions" page gives you only green folder. I thought 755 or 775 were more restrictive than 777 Link to comment Share on other sites More sharing options...
doekia Posted December 23, 2011 Share Posted December 23, 2011 Yes on directory 755 means owner full rights (ftp user), group(read browse), everyone (read, browse) On file the browse mean execute The web server neads only read for displaying page, while during install/configuration it needs write to the folder and write on the file if it exists. Raison why I said recursive! Link to comment Share on other sites More sharing options...
Aldeag Posted December 23, 2011 Author Share Posted December 23, 2011 Anyway I tryed 755, 775 and 777 all recursive with no luck. Link to comment Share on other sites More sharing options...
doekia Posted December 23, 2011 Share Posted December 23, 2011 Can you PM me with your FTP access? I'll have a look. By the way 777 on file can raise security exception it mean execute while those are scripts interpreted. Hoster can have ban this on user files. Link to comment Share on other sites More sharing options...
Aldeag Posted January 5, 2012 Author Share Posted January 5, 2012 Thanks for your interest Doekia. I´ve been out for holidays and, though I came in the forum a few times, I couldn´t check the FTP access which was on another computer I use for it. Anyway, I got the solution today from other user in the spanish forum ("4webs.es") and seemed so simple I feel silly: In Back Office, I restarted the module. Don´t delete the first Item (Julien Breux (link)) It was the first thing I always did, and I don´t know if it´s a bug. Then I can add the rest of the items. Now I have the bar working Link to comment Share on other sites More sharing options...
Vilas Posted October 18, 2012 Share Posted October 18, 2012 Hi, My theme support latest version of smart but one of module not. Also that member is no longer devloping that module. So is there is anyway to make that module compitable with smart set to yes. Thanks Link to comment Share on other sites More sharing options...
benjamin utterback Posted October 18, 2012 Share Posted October 18, 2012 Hello vilas, there is certainly a way. However, it seems that you would need professional help in order to make the module compatible. Link to comment Share on other sites More sharing options...
Vilas Posted October 19, 2012 Share Posted October 19, 2012 (edited) Dear Benjamin Utterback, Can I upload that module on our site as it was free to use offered by one of our community member. So that you may have a look on it. If its simple then will do changes. If critical then will hire professionals. Thanks Edited October 19, 2012 by Vilas (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now