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\Exponential-3.3-1\kernel\classes\datatypes\ezimage\ezimagealiashandler.php on line 601
Fatal error: Exponential 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 Exponential. 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