Page 1 of 1

Error editing or adding new pages - content blocks missing

Posted: Mon Dec 03, 2012 4:36 pm
by cypher6x
I am running version 1.11.3 and recently upgraded from the previous version.

PHP 5.3.10
MySql 5.1.65

I am not sure when this broke as I have been updating without editing pages for a while. I think it worked in 1.11.

When attempting to edit a page or create a new page the first part of the admin panel (menu, crumbtrail) is rendered but the content blocks nor the page options are rendered. Please see the attachement below.

I have looked at the 1.11.3 release notes and it states
Because of the way that CMSMS 1.11.x uses smarty in the admin interface to parse templates for validity and to find content blocks, and because many plugins are not loaded into smarty during admin console requests, some users encountered errors or blank screens when adding/editing content using some templates, or editing some page templates.

This was due to syntax such as {$content_obj→method()} or {cms_lang assign=’nls’} where the {$nls} variable was expected to represent an object. Thanks to the efforts of Tapio, we have solved the issue with blank pages when editing certain page templates, or adding or editing pages using these templates. Tapio researched, tested, and implemented a change to the way we parse templates so that variables such as these are ignored on the admin interface for the purposes of parsing the template for validity. This is an important update, intended to provide stability and performance to CMSMS for quite a while whilst we work on the next great feature release.
I am using code like {assign var='meta_canonical' value=$content_obj->GetURL()} and various other assignments and global variable for language codes etc.

Is there a general way to fix this error that has been documented in the forum. I have searched but have only being finding solutions to individual problems and none for a general fix.

Re: Error editing or adding new pages - content blocks missi

Posted: Mon Dec 03, 2012 5:29 pm
by cypher6x
Being trying to track this down by removing code and trying to see if the template renders. Quite painful as commenting out the code does not help as it still seems to get rendered by the system/smarty parser.

Is that a bug? Shouldn't the smarty parser ignore code in {* smarty comments *} ?

I have been though most of the template and the {menu} tag is the latest one that seems to cause the problem. When I remove it the template renders just fine. Adding it breaks again. I have tried {Menu} which does work but when rendering the actual website you get an error saying "No such tag called {Menu}.

So lowercase {menu} fails at the backend and uppercase {Menu} fails at the front end. The menu I have is just {strip} {/strip} so there is no code in it that could be causing the problem.

Any help would be appreciated as I have spent all day painfully adding individual lines of code from a very large template and hitting save over and over and over ;-)

Re: Error editing or adding new pages - content blocks missi

Posted: Tue Dec 04, 2012 6:30 pm
by cypher6x
So I managed to work out what was breaking and upgrading to the latest class.Smarty_Parser.php has solved the problem.

Re: Error editing or adding new pages - content blocks missi

Posted: Tue Jan 29, 2013 8:39 pm
by Dr.CSS