Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-31292

ez_image_alias throws 500 if getting used with ImageAsset field

    XMLWordPrintable

Details

    Description

      Steps to reproduce:
      1. Create a new ContentType (myimage identifier) with ImageAsset field with asset identifier.
      2. Set up a new image variation: 

      ezpublish:
          system:
              default:
                  image_variations:
                      square:
                          reference: null
                          filters:
                              - {name: geometry/scaledownonly, params: [100, 100]}
      

      3. Extend full template for the newly created ContentType:

      ezpublish:
          system:
              site_group:
                  content_view:
                      full:
                          myimage:
                              template: full/myimage.html.twig
                              match:
                                  Identifier\ContentType: myimage
      
      {% block content %}
          {% set image_alias_field = ez_field(content, 'asset') %}
          {% set alias = ez_image_alias(image_alias_field, content.versionInfo, 'square') %}
          <img src="{{ alias.uri }}">
      {% endblock %}
      

      4. Create new Content of created ContentType and view it using the full URL.

      5. Clear cache if the exception does not occur.

      Result:
      500 Exception

      Expected result:
      No exception

      Attachments

        Activity

          People

            Unassigned Unassigned
            bartlomiej.wajda@ibexa.co Bartłomiej Wajda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: