is_valid usage difficult, bug?

Author Message

Tore Skobba

Tuesday 13 January 2004 4:26:34 am

Hi

I am using the new is_valid template operator. But I am having difficulties in using it.

It get this to work:
{let content=$node.data_map.image.content}
{section show=$content.is_valid}
We have an image.
{section-else}
No image has been uploaded.
{/section}
{/let}

But this does not work (using within an section loop going through several children):
{let content=$Child:item.data_map.thumbnail.content}
{section show=$content.is_valid}
IMAGE
<div class="image_left">{attribute_view_gui attribute=$Child:item.data_map.thumbnail image_class=small}</div>
{section-else}
NO IMAGE
{/section}
{/let}

In the above the {section-else} is never true, even if there is not an image.

Neither does this work (dropped the "let"):
{section show=$node.data_map.thumbnail.content.is_valid}
We have an image.
{section-else}
No image has been uploaded.
{/section}

This causes an fatal error. So now I am wondring if anyone else have experinced this, or am I using it wrong?

Cheers
Tore

Jan Borsodi

Tuesday 20 January 2004 6:36:35 am

Regarding the fatal error:
Try to turn off template compiling in site.ini, there is a bug in the compiling code that causes the new image template code to malfunction in some cases.

This could perhaps also be the source of the problem in the loop?

The fix will be out for 3.2-5, 3.3-3 and in trunk.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

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 09:59:52
Script start
Timing: Jan 19 2025 09:59:52
Module start 'layout'
Timing: Jan 19 2025 09:59:52
Module start 'content'
Timing: Jan 19 2025 09:59:52
Module end 'content'
Timing: Jan 19 2025 09:59:52
Script end

Main resources:

Total runtime0.0177 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.1563152.6250
Module start 'layout' 0.00470.0032 741.781339.4453
Module start 'content' 0.00790.0076 781.226689.3203
Module end 'content' 0.01550.0021 870.546930.3047
Script end 0.0177  900.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003016.6517140.0002
Check MTime0.00147.6314140.0001
Mysql Total
Database connection0.00063.253710.0006
Mysqli_queries0.002715.000630.0009
Looping result0.00000.079310.0000
Template Total0.00179.810.0017
Template load0.00105.882210.0010
Template processing0.00073.901710.0007
Override
Cache load0.00084.494710.0008
General
dbfile0.002313.087480.0003
String conversion0.00000.084740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

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

Time used to render debug report: 0.0001 secs