Forums / Install & configuration / template engine won't set a variable???

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.

eZ debug

Timing: Jan 30 2025 21:19:05
Script start
Timing: Jan 30 2025 21:19:05
Module start 'content'
Timing: Jan 30 2025 21:19:05
Module end 'content'
Timing: Jan 30 2025 21:19:05
Script end

Main resources:

Total runtime0.2398 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.0547370.2813
Module start 'content' 0.00620.0136 958.33591,001.5938
Module end 'content' 0.01980.2199 1,959.92973,892.9922
Script end 0.2397  5,852.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00411.7075200.0002
Check MTime0.00130.5226200.0001
Mysql Total
Database connection0.00070.305310.0007
Mysqli_queries0.149962.52691410.0011
Looping result0.00150.63531390.0000
Template Total0.219691.610.2196
Template load0.00070.308510.0007
Template processing0.218891.258310.2188
Override
Cache load0.00050.210210.0005
Sytem overhead
Fetch class attribute can translate value0.00190.775810.0019
XML
Image XML parsing0.00020.093010.0002
General
dbfile0.00622.5710200.0003
String conversion0.00000.001330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs