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.

eZ debug

Timing: Jan 19 2025 12:44:42
Script start
Timing: Jan 19 2025 12:44:42
Module start 'layout'
Timing: Jan 19 2025 12:44:42
Module start 'content'
Timing: Jan 19 2025 12:44:43
Module end 'content'
Timing: Jan 19 2025 12:44:43
Script end

Main resources:

Total runtime0.7353 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 590.4141152.6406
Module start 'layout' 0.00420.0029 743.054739.4766
Module start 'content' 0.00710.7264 782.5313431.5156
Module end 'content' 0.73350.0017 1,214.046912.2969
Script end 0.7353  1,226.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.3985160.0002
Check MTime0.00120.1645160.0001
Mysql Total
Database connection0.00060.078010.0006
Mysqli_queries0.694694.4546520.0134
Looping result0.00060.0763500.0000
Template Total0.708296.320.3541
Template load0.00220.297520.0011
Template processing0.705996.003820.3530
Template load and register function0.00020.030310.0002
states
state_id_array0.00100.137110.0010
state_identifier_array0.00130.175320.0006
Override
Cache load0.00180.2409180.0001
Sytem overhead
Fetch class attribute can translate value0.00080.111810.0008
Fetch class attribute name0.00130.172720.0006
XML
Image XML parsing0.00010.016210.0001
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.00080.1046100.0001
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs