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

Error when rendering empty Selection field

    XMLWordPrintable

Details

    Description

      in preview mode if Selection filed is empty (ezselection) this give an error:

      Key "0" does not exist as the array is empty in EzPublishCoreBundle::content_fields.html.twig at line 170
      500 Internal Server Error - Twig_Error_Runtime

      Frontend doesnt output the error using {{ content.getFieldValue('SELECTION-FILED-NAME') }}

      Error demo at:
      http://www.screencast.com/t/lV6J9ieLlDz

      fixing the Problem adding following condition in :
      /ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig
      Line 170.

      {% elseif not fieldSettings.isMultiple %}

      {% elseif not fieldSettings.isMultiple and field.value.selection.0 is defined %}

      Attachments

        Activity

          People

            Unassigned Unassigned
            0aaceb1b-a090-4e10-828b-43959cfe7efe@accounts.ibexa.co Ramzi Arfaoui
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: