template engine won't set a variable???

Author Message

Terry Grossman

Monday 05 July 2004 11:46:53 pm

Everything works in my template EXCEPT updating a string variable (dtrack, in the code listed below). I get this error message

Undefined variable: var1 in /home/ftkfztae/public_html/content/var/plain/cache/template/compiled/month_small-bfb17f33367b866af2e2178d0bde04a8.php on line 327

when the template is used. Clearing the template cache does nothing.

I found something that seems related under bug fixes, but there is no work-around, or instructions given to fix the problem. Somebody PLEASE let me know how to accomplish this (should-be) trival string assignment!

It took me about an hour to realize I was running up against (apparently) a kernel/compiler error...frustration level is way high...Apologies if this message should get posted somewhere other than "installation issues"

<table rules="none">
<thead>
    <tr>
        <td>Mon</td>
        <td>Tue</td>
        <td>Wed</td>
        <td>Thu</td>
        <td>Fri</td>        
        <td>Sat</td>        
        <td>Sun</td>        
       
    </tr>
</thead>
<tbody>
   {let dtrack="b"}
    {section name=week loop=5}
        <tr>
        {section name=weekday loop=7}
           <td>   
            {switch match=$dtrack}
              {case match="b"}  {set dtrack=cond($events[$week:index][$week:weekday:index][day]|compare("01"),"i",
                                                                           "b")} 
                       +{cond($events[$week:index][$week:weekday:index][day]|compare("01"),"i","b")}+
              {/case}
              {case match="i"}  {set dtrack=cond($events[$week:index][$week:weekday:index][day]|compare("01")|eq(1),"a","i")} {/case}
              {case} {/case}
            {/switch}

            {set dtrack=trim("i")}
            ={$dtrack}=

            {section name=check_prev show=$dtrack|eq("b")}
              <a class="prev_month" href="./day?timestamp={$events[$week:index][$week:weekday:index][start_time]}">{$events[$week:index][$week:weekday:index][day]}</td>
            {/section}

            {section name=check_in show=$dtrack|eq("i")}
              <a class="this_month" href="./day?timestamp={$events[$week:index][$week:weekday:index][start_time]}">
                 {$events[$week:index][$week:weekday:index][day]}</td>
            {/section}

            {section name=check_after show=$dtrack|eq("a")}
              <a class="next_month" href="./day?timestamp={$events[$week:index][$week:weekday:index][start_time]}">
                 {$events[$week:index][$week:weekday:index][day]}</td>
            {/section}

        {/section}
        </tr>
    {/section}
  {/let}
</tbody>
</table>

Terry Grossman

Monday 05 July 2004 11:56:39 pm

I just checked my versions...

The bug report says this was Fixed in 3.4 beta2 (Rev. 6508)

But I'm using 3.4 (stable) which was released on 02 June 2004 and which I downloaded and installed on 23 June 2004.

The changelog for my install includes the line
- Fixed "Undefined variable" and "Undefined index" notices in the template compiler.
http://ez.no/community/bug_reports/template_compile_undefined_index_result

But it looks like it is still happening

T.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.