smarty template errors after upgrading 1.10.3 to 1.11(.2)

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
ImkerMike
New Member
New Member
Posts: 2
Joined: Wed Nov 07, 2012 7:08 pm

smarty template errors after upgrading 1.10.3 to 1.11(.2)

Post by ImkerMike »

hello ,

after upgrading to cmsms version 1.11 I got many smarty errors.
the admin backend works fine.

At frontends view I got an "OMG You broke this page" error site. ???

Syntax Error in template "tpl_body:23" on line 166 "</__html>" unclosed {if} tag

This occures imediately after upgrade.
During upgrade I verified all the files using the checksum file. All upgrade steps were done well without any error or notice ( except a warning about my php version that is 5.2.9 )

How can I locate the template that causes this error?

I disabled all the modules installed ( except CMSPrinting ) but nothing changes.


any suggestions?

thanks in advance

Mike
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: smarty template errors after upgrading 1.10.3 to 1.11(.2

Post by calguy1000 »

CMSMS 1.11.x uses Smarty v3 ... Smarty3 uses a real lexer and parser, and is therefore much more sensitive to syntax errors than the old smarty2 was.

You will have to fix your syntax errors, particularly watching for unclosed or mismatched quotes.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
gdur
Forum Members
Forum Members
Posts: 142
Joined: Sun Jan 10, 2010 10:59 am

Re: smarty template errors after upgrading 1.10.3 to 1.11(.2

Post by gdur »

Hi,
You're not the only one I'm afraid. Luckely I decided to test the upgrade first on a test site (a copy of my production site) and guess what the upgrade failt big time!
I decided to do a fresh install and to copy all content manually. A hefty process given the number of pages. Starting off with copying the templates which became some kind of Russian roulette with trial and error to figure out what needed to be changed to get it to work. I managed to modify the 2 major templates (not understanding how and what are the current rules regarding templates as off version 1.11.2) but as optimistic as I am I started to port the content. The first bunch was just flat content and that went fine. Then I got to the pages calling third party modules, grrr, another series of Russian roulette was needed to get through the first one until I discovered that I had to change the call cms_module into CMS_module. Yes that's right, only changing the first bit into upper case did the trick(???) Where is the logic? At last I got to the point porting the pages using "Hiding Private Content in CMS Made Simple". The associated templates containing the specific Smarty code failed to save. After trying almost everything I gave up and decided to raise it as a bug in FEU. Calguy responded almost immediately explaining that this wasn't a bug but that
"it's a change in the way templates are processed in the CMSMS backend"
but suggested also a fix which sadly doesn't work and now I'm stuck. I guess that a lot of 3rd party modules will suffer from the same so my advise for now is to wait with an upgrade until these issues are all resolved. The latest working version I have is 1.10.3. So stick with that or downgrade back to 1.10.3.
ImkerMike
New Member
New Member
Posts: 2
Joined: Wed Nov 07, 2012 7:08 pm

Re: smarty template errors after upgrading 1.10.3 to 1.11(.2

Post by ImkerMike »

well ...

I found the "tpl_body:23" references the template with (internal) id 23 - so I looked for that. This was the default template I defined.

I did not find any misspelled tags in it. So I removed the {if}{else}{/if} blocks entirely, just to try it. These changes could _not_ be saved. Trying to save gives an incomplete or empty page. Looking at the servers error-log I found this while saving the temlate:

Code: Select all

PHP Fatal error:  Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "template:appdata;tmp_template"  on line 209 "</__html>" unclosed {if} tag' in /var/www/vhosts/xxx/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:656\nStack trace:\n  ... referer: http://xxx/admin/edittemplate.php?_sx_=0e762c67&template_id=23

However .. I edited the template code directly within the templates table - that works. This way I found the block containing the misspelled tag(s) and corrected them. ( I found an {/if}-Tag spelled like this: { /if } - with spaces! - ... that's it ! *damn! )

The problem is solved so far.

- mike -
inyerface
Forum Members
Forum Members
Posts: 191
Joined: Mon Nov 26, 2007 4:46 pm

Re: smarty template errors after upgrading 1.10.3 to 1.11(.2

Post by inyerface »

Same problem. But for large sites with many modules, this is a pain in the butt. Worst upgrade process ever.

First, when I copied the 1.11 files over the 1.10.3 I received a SelfRegistration error. So I opted to upgrade the modules before the core but SelfRegistration required the latest FEU 1.20 and then... An error stating I needed a new version of CMSMS. I was kind of stuck in a bit of a loop.

So I thought I had figured everything out until I tried to edit a page... it was blank. I tried updating the template and on Submit got a 404 error.

Not motivating at all.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: smarty template errors after upgrading 1.10.3 to 1.11(.2

Post by calguy1000 »

There is not much we can do about this. The Smarty3 parser is much more flexible, and feature rich than the smarty2 one ever was. It is also much more strict about syntax, including quotes and apparently whitespace in tags. Though I haven't yet encountered the whitespace problem myself.

The features of smarty3 do outweigh most of the problems we've encountered. Namely the better merging of javascript into smarty templates, and the template inheritance capabilities.

We are experimenting with ways of improving the template editing experience with smarty3, and hope to have something for CMSMS 1.11.3, but at this point we cannot promise anything.

BTW, Blank screens are indicating a php error. Viewing your error log, or admin log would probably tell you what they were. Or you could enable debug mode.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “[locked] Installation, Setup and Upgrade”