Forums / Setup & design / New image system usage within templates problems, ez crashses

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

eZ debug

Timing: Jan 18 2025 19:26:56
Script start
Timing: Jan 18 2025 19:26:56
Module start 'content'
Timing: Jan 18 2025 19:26:56
Module end 'content'
Timing: Jan 18 2025 19:26:57
Script end

Main resources:

Total runtime0.8127 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 587.9688180.7969
Module start 'content' 0.00770.6480 768.7656645.4531
Module end 'content' 0.65570.1570 1,414.2188337.0547
Script end 0.8126  1,751.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4774210.0002
Check MTime0.00150.1822210.0001
Mysql Total
Database connection0.00080.104210.0008
Mysqli_queries0.730389.85912040.0036
Looping result0.00230.27812020.0000
Template Total0.786796.820.3934
Template load0.00210.262620.0011
Template processing0.784696.538220.3923
Template load and register function0.00010.017210.0001
states
state_id_array0.00070.085810.0007
state_identifier_array0.00090.113220.0005
Override
Cache load0.00190.2358490.0000
Sytem overhead
Fetch class attribute can translate value0.00110.130450.0002
Fetch class attribute name0.00120.147970.0002
XML
Image XML parsing0.00200.247350.0004
class_abstraction
Instantiating content class attribute0.00000.001770.0000
General
dbfile0.00240.3008350.0001
String conversion0.00000.000730.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs