New image system usage within templates problems, ez crashses

Author Message

Tore Skobba

Monday 12 January 2004 4:15:29 am

Hi

Using Ez 3.3.1 for site where I am making an template which require various output whereever there is an actual image or not.

By reading here (New image systems, http://ez.no/developer/ez_publish_3/releases/ez_publish_3_3/new_image_system) I have learnt this:

{let content=$node.data_map.thumbnail.content}
{section show=$content.is_valid}
We have an image.
{section-else}
No image has been uploaded.
{/section}
{/let}

I rewritte this in order to skip the "let" to this:

{section show=$node.data_map.thumbnail.content.is_valid}
We have an image.
{section-else}
No image has been uploaded.
{/section}
{/let}

But this cause EZ to crash! Anyone know why???

Update: This also causes EZ to crash:
{$node.data_map.thumbnail.content.medium.full_path}

Cheers
Tore

Paul Borgermans

Monday 12 January 2004 4:33:41 am

What about removing the closing {/let} also?

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Tore Skobba

Monday 12 January 2004 4:45:43 am

Hi

Thanks, I have removed it... Still same error:

Fatal error: Call to a member function on a non-object in c:\develop\ez_gsa\ezpublish-3.3-1\kernel\classes\datatypes\ezimage\ezimagealiashandler.php on line 601
Fatal error: eZ publish did not finish it's request

Have anyone else had the same problem? Could this be a bug? Or is my code wrong?

cheers
Tore

Lauren Matheson

Friday 16 January 2004 10:52:19 pm

I have similar activity going on, seems that there is trouble building the .content ezimagealiashandler object when there is no image. This must be a bug?

Jan Borsodi

Tuesday 20 January 2004 6:43:42 am

We just found a bug in the template compiling that causes templates with image code to crash eZ publish. You can fix this temporarily by turning off template compiling or rewriting the templates.

Rewriting templates:
Instead of accessing the content of the attribute multiple times assign the content to a new variable and access this one for all sizes.

{let content=$node.data_map.thumbnail.content}
{$content.original.url}
{$content.small.url}
{/let}

The fix is already in the subversion repositories for those who want it, it's fixed for 3.2, 3.3 and trunk (3.4).

--
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 18 2025 20:57:21
Script start
Timing: Jan 18 2025 20:57:21
Module start 'layout'
Timing: Jan 18 2025 20:57:21
Module start 'content'
Timing: Jan 18 2025 20:57:22
Module end 'content'
Timing: Jan 18 2025 20:57:22
Script end

Main resources:

Total runtime0.6554 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.1719152.6563
Module start 'layout' 0.00530.0021 740.828139.5078
Module start 'content' 0.00740.6468 780.3359640.3438
Module end 'content' 0.65420.0012 1,420.679712.0938
Script end 0.6554  1,432.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4630160.0002
Check MTime0.00120.1894160.0001
Mysql Total
Database connection0.00070.113610.0007
Mysqli_queries0.600591.6192670.0090
Looping result0.00060.0877650.0000
Template Total0.630996.320.3154
Template load0.00200.298920.0010
Template processing0.628995.953020.3144
Template load and register function0.00020.023910.0002
states
state_id_array0.00090.141710.0009
state_identifier_array0.00070.108420.0004
Override
Cache load0.00170.2621490.0000
Sytem overhead
Fetch class attribute can translate value0.00060.090740.0001
Fetch class attribute name0.00110.164370.0002
XML
Image XML parsing0.00130.197540.0003
class_abstraction
Instantiating content class attribute0.00000.001870.0000
General
dbfile0.00200.3037240.0001
String conversion0.00000.001240.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs