Jump to content

Categories: Fatal error: Smarty error: syntax error: unrecognized tag: $node.link|escape:html:''UTF-


Recommended Posts

Hello everyone.

 

I'd re-categorizing some products and add some discounts, in the Prestashop Adminshop.

When I went to the homepage to test the re-categorizing, i received the following error:

'Categories'

 

Fatal error: Smarty error: [in /home/xxxxxxxx/public_html/onlineshop/modules/blockcategories/category-tree-branch.tpl line 2]: syntax error: unrecognized tag: $node.link|escape:html:''UTF-8'' (Smarty_Compiler.class.php, line 446) in /home/xxxxxxxx/public_html/onlineshop/tools/smarty/Smarty.class.php on line 1095

 

Category-tree-branch.tpl line 2

 

<a href="{$node.link|escape:html:'UTF-8'}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>

 

Smarty.class.php line 1095

trigger_error("Smarty error: $error_msg", $error_type);

 

I'm currently using Version 1.3.6.0

 

Any ideia?

Thanks for the help.

Edited by cdaniel.marques (see edit history)
Link to comment
Share on other sites

Hi Daniel,

Before we try to debug things, can you try to 'reset' the module in Back office (Not familiar with 1.3.x, but assume that existed already by then). Otherwise de-install and reinstall the module and see if that helps.

 

thx,

pascal

Link to comment
Share on other sites

Can you try to change this in the file:

Category-tree-branch.tpl line 2

 

 

<a href="{$node.link|escape:html:'UTF-8'}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>

Link to comment
Share on other sites

Hello Pascal,

 

Tried change the Category-tree-branch.tpl line 2, like so:

<a href="{$node.link}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>

but received the same error.

 

Fatal error: Smarty error: [in /home/rpfkayak/public_html/onlineshop/modules/blockcategories/category-tree-branch.tpl line 2]: syntax error: unrecognized tag: $node.desc|escape:html:''UTF-8'' (Smarty_Compiler.class.php, line 446) in /home/rpfkayak/public_html/onlineshop/tools/smarty/Smarty.class.php on line 1095

 

I'm gona also try reset the module.

Edited by cdaniel.marques (see edit history)
Link to comment
Share on other sites

I've noticed this right now.

I'm also receiving the following errors on PrestaShop BackOffice Modules:

Parse error: syntax error, unexpected T_STRING in /home/xxxxxxxx/public_html/onlineshop/classes/Module.php(323) : eval()'d code on line 3

Parse error: syntax error, unexpected T_STRING in /home/xxxxxxxx/public_html/onlineshop/classes/Module.php(323) : eval()'d code on line 10

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/xxxxxxxx/public_html/onlineshop/classes/Module.php(323) : eval()'d code on line 5

 

Will post the lines in a minute.

 

Also receiving in the same error in Payment Tab.

Edited by cdaniel.marques (see edit history)
Link to comment
Share on other sites

Hello Pascal,

 

Tried change the Category-tree-branch.tpl line 2, like so:

<a href="{$node.link}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>

but received the same error.

 

Fatal error: Smarty error: [in /home/rpfkayak/public_html/onlineshop/modules/blockcategories/category-tree-branch.tpl line 2]: syntax error: unrecognized tag: $node.desc|escape:html:''UTF-8'' (Smarty_Compiler.class.php, line 446) in /home/rpfkayak/public_html/onlineshop/tools/smarty/Smarty.class.php on line 1095

 

I'm gona also try reset the module.

 

 

Hi Daniel,

Actually it DID change the message error. The message is now not about the first href string, but the next one with the escape stuff in it.

 

So let's try this:

<a href="{$node.link|escape:html:'UTF-8'}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>

 

And see if that brings us further.

 

Please post the source lines that are mentioned in the error lines of your post #7. Thanks.

Link to comment
Share on other sites

Hello Pascal,

 

Did the change that you suggested, i'm getting a diferent error in FrontPage:

Fatal error: Smarty error: [in /home/rpfkayak/public_html/onlineshop/modules/blockmanufacturer/blockmanufacturer.tpl line 10]: syntax error: invalid attribute name: 'about''' (Smarty_Compiler.class.php, line 1550) in /home/xxxxxxxx/public_html/onlineshop/tools/smarty/Smarty.class.php on line 1095

 

The sources lines #3, 5 and 10, of module.php, on post #7, are:

3 - /**
 * Module class, Module.php
5 - * Modules management
 * @category classes
 *
 * @author PrestaShop <[email protected]>
 * @copyright PrestaShop
10 - * @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0
 * @version 1.3
 *
 */

Wich doesn't look right, because are comments, but I cant find the "eval()'d code" procedure.

Edited by cdaniel.marques (see edit history)
Link to comment
Share on other sites

1- <?php
2-
3- /**
4-   * Module class, Module.php
5-   * Modules management
6-   * @category classes
7-   *
8-   * @author PrestaShop <[email protected]>
9-   * @copyright PrestaShop
10-   * @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0
11-   * @version 1.3
12-   *
13-   */
14-
15- 1- abstract class Module
16- 2- {
17- 3- /** @var integer Module ID */
18- 4- public $id = NULL;
19- 5-
20- 6- /** @var float Version */
21- 7- public $version;
22- 8-
23- 9- /** @var string Unique name */
24- 10- public $name;
25- 11-
26- 12- /** @var string Human name */
27- 13- public $displayName;
28- 14-
29- 15- /** @var string A little description of the module */
30- public $description;
31-
32- /** @var string Admin tab correponding to the module */
33- public $tab = NULL;

   /** @var boolean Status */
   public $active = false;

   /** @var array current language translations */
   private $_lang = array();

   /** @var string Module web path (eg. '/shop/modules/modulename/')  */
   protected $_path = NULL;

   /** @var string Fill it if the module is installed but not yet set up */
   public $warning;

   /** @var string Message display before uninstall a module */
   public $beforeUninstall = NULL;

   public $_errors = false;

Edited by cdaniel.marques (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hi Daniel, there are 10 steps they mention to restore a backup in the Advanced Parameters-DBBackup screen (Yellow Box on the right) Read through them and see if you can work it out.

 

Make sure you make a NEW backup BEFORE you do the restore, so you have a current backup with current states if anything goes wrong restoring the old one. Just in case...

 

My 2 cents,

pascal

Link to comment
Share on other sites

  • 2 weeks later...

Hello Pascal (or everyone who can help me, please)

 

I'm also involved in this shop. To start i must say that i have never had any experience with PrestaShop nor with any other online shop platform. But i'm a programmer so i've tryed to, somehow, figure things out.

 

Here's what i've learned/discovered:

 

All TPL files seems to have sintaxe errors. Why do i say this? Because, when looking to the PrestaShop reported errors (let's say, for instance, the one that Daniel firstly reported - Fatal error: Smarty error: [in /home/xxxxxxxx/public_html/onlineshop/modules/blockcategories/category-tree-branch.tpl line 2]: syntax error: unrecognized tag: $node.link|escape:html:''UTF-8'' (Smarty_Compiler.class.php, line 446) in/home/xxxxxxxx/public_html/onlineshop/tools/smarty/Smarty.class.php on line 1095)

 

I tryed to undestand it and somehow fix it.

 

Let me give you an example: in homefeatured.tpl theres something like: <h4>{l s='Featured products' mod='homefeatured'}</h4>

In this case i simply changed the apostrophe (') for a quote (") like this: <h4>{l s="Featured products" mod="homefeatured"}</h4>
 
Also in the same files i have found: title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}"
So i just add spaces between the pipe and the surrouding text, like: title="{$product.name | truncate:32:'...' | escape:'htmlall':'UTF-8'}"
 

And, actually i've managed to make things work wherever i applyed this changes. But there are thousands of TPL files... 

 

So i've made a little program that parses through all the TPL files and aplys this kind of changes. And it worked! Well, almost...

 

With this changes i started to get the most of the shop. But then i got some PHP sintaxe errors. And wherever i corrected them i've got it to work. But there are to many PHP files and the kind of sintaxe errors are impossible to fix with te same kind of approach i've used with the TPL files.

 

My conclusion: there seems to be a bunch of sintaxe errors across the TPL and PHP files.

My guess: could this be caused by some kind of interrupted upgrading or for some script?

 

My questions:

a) Could this really be like i've said, or am i just dreaming and i really don't know what i'm saying?  :)

B) Is there any way to sort this out?

 

Any contribution is welcome. I'm breaking my head with this for days!!! I really need help, please.

Thank you very much.

Link to comment
Share on other sites

Hi hjno,

Wat you describe seems like there MUST be something else wrong. I do not believe that PrestaShop has errors in all tpl files, as 1000's of people use it without making changes.

 

I think we have to check the php.ini settings, and as I read your post, there might be especially a problem with quotes.

 

There is a setting in php that changes the way php looks at quotes:

It is necessary to disable Magic Quotes
http://www.php.net/m...s.disabling.php

 

If access to the server configuration is unavailable, use of .htaccess is also an option. For example:
php_flag magic_quotes_gpc Off

 

Maybe try to have a look at this. Not sure if this is the cause, but give it a try...

 

My 2 cents,

pascal

Link to comment
Share on other sites

hjno,

 

If I look at the very first error message posted by Daniel:

Fatal error: Smarty error: [in /home/xxxxxxxx/public_html/onlineshop/modules/blockcategories/category-tree-branch.tpl line 2]: syntax error: unrecognized tag: $node.link|escape:html:''UTF-8'' 

 

You see that it complains about '', not '   (N.B. notice that the '' are two single 's ( ' + ' ), not one singe " (double-quote)

So something is translated there from ' to ''

Might very well have to do with these magic quotes...

Link to comment
Share on other sites

You are very quick! Thank you very much. 

 

Of course it with be very odd if PrestaShop could do such kind of errors. I thought of something abou configuration, but, as i told you, my PrestaShop knowledge is very little.

 

I will try that and will let you know the result.

 

Thanks.

Link to comment
Share on other sites

Hello again.

 

I've tryed to include php_flag magic_quotes_gpc Off in the .htaccess file but i got an internal error when entering the store (online).

 

I've found two .htaccess files; one in "public_html" folder and the other in my shop root. Wish one? (i've tryed both and got the same error).

 

I simply wrote php_flag magic_quotes_gpc Off at end of the file.

 

What am i doing wrong? 

 

As to the other sugestionyou've made (php.ini), i don't know how to get to the PHP.ini settings.

 

As i told you, i'm completly rookie on PrestaShop.

 

Thanks.

Link to comment
Share on other sites

Hmm, may be either case sensitive (I wrote Off in previous mail)

 

php_flag magic_quotes_gpc off

 
or the php is not run as a module :-(
 
php.ini is maybe not available for you, as you may use a shared host. (Not all open this file up then)
I believe there's another way, but please first try above modification
 
I'll have a look tomorrow for other solutions. It's 3.15 am here...
 
 
Maybe you can have a  look here yourself in the meantime:
 
goodnight,
pascal
Link to comment
Share on other sites

×
×
  • Create New...