Page 1 of 1

SOLVED: 1.11.3 Smarty probleem (wit scherm) bij wijzigen

Posted: Thu Nov 22, 2012 3:09 pm
by eus
Hoi,

Blank pages problem, easy to reproduce. Never had this problem before.


Html block named "begin":

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
{assign var="pretty" value="/"|explode:$smarty.get.page}
{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if}
<title>{title} | {sitename}</title>
{metadata}
{cms_stylesheet}
  </head>

Template
-----------
{global_content name='begin'}
</__body>
{$pretty[0]}
{content}
<__body>
</__html>
----------
Save gives white screen !!!

/tmp/cache/debug.log gives ...

ERROR DETECTED: Cannot use object of type CMSMS_Dummy_Variable_Value as array at /var/www/vhosts/q-wash.nl/httpdocs/preview/tmp/templates_c/parser1353596484^dd10a1840f43813cd647195dd79bd3add047c6e9.template.appdata;tmp_template.php:30

You can't save the brackets [ ] !

{$pretty|print_r} gives the correct values so it's only a bug in edittemplate.php i guess.

You can save html block with variables like $pretty[1]

Thnx

Re: 1.11.3 Smarty probleem (wit scherm) bij wijzigen Sjabloo

Posted: Thu Nov 22, 2012 3:30 pm
by Jos
thx... this is an already known issue. It's related to the use of arrays in templates. Stikki is working on it

Re: 1.11.3 Smarty probleem (wit scherm) bij wijzigen Sjabloo

Posted: Thu Nov 22, 2012 3:32 pm
by deactivated010521
----------

Re: 1.11.3 Smarty probleem (wit scherm) bij wijzigen Sjabloo

Posted: Thu Nov 22, 2012 3:38 pm
by eus
arnoud wrote:Wat doet glow?

Code: Select all

[glow]{assign var="pretty" value="/"|explode:$smarty.get.page}[/glow]
glow hoort er niet bij maar was bedoelt om de smarty assign te accentueren. Dat werkt blijkbaar niet in dit forum. Het glow knopje in de editor van dit forum. ik heb het verwijderd in de orginele post nu.

Re: 1.11.3 Smarty probleem (wit scherm) bij wijzigen Sjabloo

Posted: Thu Nov 22, 2012 3:54 pm
by Stikki
Hello folks!

Many thanks to Jos reporting this at the first place.

Fixed in SVN.

Problem was that dummy object wasn't callable as ArrayObject, now it is.

Copy & overwrite:

lib/classes/class.Smarty_parser.php

Or:

Wait for fix release.

I am really sorry, this whole thing lacked some testing, etc...

-Stikki-

Re: 1.11.3 Smarty probleem (wit scherm) bij wijzigen Sjabloo

Posted: Thu Nov 22, 2012 3:56 pm
by eus
Jos wrote:thx... this is an already known issue. It's related to the use of arrays in templates. Stikki is working on it
Thnx for the quick response

Re: 1.11.3 Smarty probleem (wit scherm) bij wijzigen Sjabloo

Posted: Thu Nov 22, 2012 4:15 pm
by eus
Stikki wrote:Hello folks!

Many thanks to Jos reporting this at the first place.

Fixed in SVN.

Problem was that dummy object wasn't callable as ArrayObject, now it is.

Copy & overwrite:

lib/classes/class.Smarty_parser.php

Or:

Wait for fix release.

I am really sorry, this whole thing lacked some testing, etc...

-Stikki-
Yep, that worked !! Thnx