eZ Community » Forums » eZ Publish 5 Platform » Invalid variation for image
expandshrink

Invalid variation for image

Invalid variation for image

Saturday 14 December 2013 4:36:15 pm - 3 replies

Hi

I have changed the article class image attribute to be an image instead of an object relation, so I created one article using the admin interface, and I have set the image variation 'small' in ezpublish_dev.yml, but when I try to render the field in the frontend, using ezp5, I get one error:

An exception has been thrown during the rendering of a template ("Invalid variation 'small' for image"blunk.gif Emoticon in TuteiBaseBundle:content/article:line.html.twig at line 5.

Please note that if I create the article using the php api, I don't have this problem. Does anyone have the same problem?

Monday 16 December 2013 9:17:27 am

Hi Thiago

I've come across the same problem and there were three causes/remedies:

  • cache problems
  • permission problems
  • an empty image attribute/field

To avoid the last, check for the the field not being empty with ez_is_field_empty(content, field_name).

Obviousely content_fields.html.twig does not properly check for empty image fields. Line 390 should read

{% if field.value.id %}

Regards, Donat

Modified on Monday 16 December 2013 9:18:36 am by Donat Fritschy

Monday 16 December 2013 11:02:42 am

Quote from Donat Fritschy :

Hi Thiago

I've come across the same problem and there were three causes/remedies:

  • cache problems
  • permission problems
  • an empty image attribute/field

To avoid the last, check for the the field not being empty with ez_is_field_empty(content, field_name).

Obviousely content_fields.html.twig does not properly check for empty image fields. Line 390 should read

{% if field.value.id %}

Regards, Donat

Maybe it was a cache issue 'cause I couldn't reproduce the problem today, thanks!

Monday 16 December 2013 4:39:24 pm

Now, the problem is back again, I will just use 'original' alias for a while.

Modified on Monday 16 December 2013 4:39:57 pm by Thiago Campos Viana

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from