Jump to content

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template


Recommended Posts

I am using the bank wire module for my transaction and the page goes blank when it reach the validation. 
This is the error i got. Anyone know how to solve this??

 

 

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/home/unicuzt/public_html/themes/default-bootstrap/mails/en/order_conf_product_list.txt" on line 2 "{$product[\'reference\']}" - Unexpected "\"' in /home/unicuzt/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:667 Stack trace: #0 /home/unicuzt/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 /home/unicuzt/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(10, '\') #2 /home/unicuzt/public_html/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(10, '\') #3 /home/unicuzt/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php(206): Smarty_Internal_SmartyTemplateCompiler->doCompile('{foreach $list ...') #4 /home/unicuzt/p in/home/unicuzt/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 667

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hi,

 

My version of PrestaShop is 1.6.0.8

 

The folder /themes/default-bootstrap/mails doesn't appear until you try to modify e-mail templates translations in Localization > Translations for the default-bootstrap theme.

 

Select:

Type of translation > Email templates translations

Select you theme > default-bootstrap

Select your language > your language

and hit Modify button

 

This is when the folder mails get created with its content.

 

I get exactly the same error message as posted by wyeqwen after trying to modify order_conf template from the list of available e-mail templates. You don't need to modify anything in this template to get this error. It's just enough to open order_conf template, hit Edit HTML version and without any changes save the template. Next time you try to check out you will get the following error at the last step of checkout:

 

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/htdocs/ecommerce_MERGED/mails/en/order_conf_product_list.txt" on line 2 "{$product[\'reference\']}" - Unexpected "\"' in /htdocs/ecommerce_MERGED/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:667 Stack trace: #0 /htdocs/ecommerce_MERGED/tools/smarty/sysplugins/smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 /htdocs/ecommerce_MERGED/tools/smarty/sysplugins/smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(10, '\') #2 /htdocs/ecommerce_MERGED/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(10, '\') #3 /htdocs/ecommerce_MERGED/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php(206): Smarty_Internal_SmartyTemplateCompiler->doCompile('{foreach $list ...') #4 /htdocs/ecommerce_MERGED/tools/smarty/sysplugi in /htdocs/ecommerce_MERGED/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 667

 

I cleared all caches and it doesn't get any better. I also tested it in the fresh installation of PS 1.6.0.8 with the same results. I restored the functionality of my site by copying the folder /themes/default-bootstrap/mails from a fresh installation of PS but this means that you can't apply any changes to the e-mail templates in Localization > Translations otherwise you will get this error. Anyone have found solution to this?

 

In the meantime if you need to modify any of the e-mail templates you can edit .html files in /themes/default-bootstrap/mails/your-language. It doesn't trigger the above error and applies the changes.

Edited by Jacek Es (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

please, help me fix fatal error

I got this fatal error :

 

Strict Standards: Non-static method SwitcherModel::getActiveRecords() should not be called statically, assuming $this from incompatible context in H:\New folder (2)\htdocs\jualbuku\modules\backgroundswitcher\backgroundswitcher.php on line 408

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "H:\New folder (2)\htdocs\jualbuku\themes\default\product.tpl" on line 559 "<a class="button" href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='view}">{l s='view'}</a>" - Unexpected "view", expected one of: "}" , " " , ATTR' in H:\New folder (2)\htdocs\jualbuku\tools\smarty\sysplugins\smarty_internal_templatecompilerbase.php:667 Stack trace: #0 H:\New folder (2)\htdocs\jualbuku\tools\smarty\sysplugins\smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 H:\New folder (2)\htdocs\jualbuku\tools\smarty\sysplugins\smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(19, 'view') #2 H:\New folder (2)\htdocs\jualbuku\tools\smarty\sysplugins\smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(19, 'view') in H:\New folder (2)\htdocs\jualbuku\tools\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 667

 

 

 

 

Link to comment
Share on other sites

  • 3 months later...

Hi

 

This error still exists even in 1.6.0.14 . 

 

It's basically a Prestashop hit and miss. 

If you open controllers/admin/AdminTranslationsController.php and search for submitTranslationsMails function, you'll see that only if type is "html" does the system strip the slashes added by MagicQuotes. 

 

This is what causes the error, those slashes that can't be later parsed by Smarty.

 

To fix this,  add an "else" to that "if" and add 

if (_PS_MAGIC_QUOTES_GPC_)

$content = stripslashes($content); 

to the "else".

 

Sorry for the formatting, I have no idea how to use this text editor, nor time to spend on this.

 

Good luck.

Link to comment
Share on other sites

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...