Forums / Developer / Weird behavior or bug?

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Weird behavior or bug?

Author Message

Massimiliano Bariola

Thursday 04 August 2005 4:16:15 am

    {def $dataodierna = gettime(currentdate())}
    {def $nextmonth = $dataodierna.month}
    {def $nextyear = $dataodierna.year}
    {if $dataodierna.month|eq(12)}
        {set $nextmonth = 1}
        {set $nextyear = $nextyear|inc(1)}
    {else}
        {set $nextmonth = $nextmonth|inc(1)}
    {/if}
    {if $dataodierna.month|count_chars|eq(1)}
{*the following line results in an error*}
        {set $dataodierna.month = concat('0', $dataodierna.month)}
    {/if}
    {if $nextmonth|count_chars|eq(1)}
        {set $nextmonth = concat('0', $nextmonth)}
    {/if}

the above snippet of tpl-code gives this error:

parser error @ extension/wt/design/standard/templates/wt/classifiche.tpl:69
Empty variable name at [.month = concat('0', $dataodierna.month)]

which seems pretty weird to me, because $dataodierna does exist (I use it elsewhere in my code to set other values, which get correctly set).

Bug or my mistake ?