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

Selection edit preview fails when empty

    XMLWordPrintable

Details

    Description

      Preview of empty single select Selection fails because the field.value.selection array is empty and the code assumes it won't be.
      https://github.com/ezsystems/ezpublish-kernel/blob/e2d26faa54715675fc8f1eef3defbe192973bf5b/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig#L170

      Steps to reproduce:

      • Create a new Content Type named "Selection Content Type" with two Content Fields:
        ezstring named "Title".
        ezselection named "Selection" and two options "1st option" and "2nd option", don't check Multiple.
      • Create new Content Object with "Selection Content Type" Content Type.
      • In the "Title" field type "Selection Test". Don't enter/select anything for the Selection field.
      • In the right menu, click the computer monitor under "Preview"
      • This fails with HTTP 500: Key "0" does not exist as the array is empty.

      Expected: The preview should work without errors, and display an empty selection.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gunnstein.lye@ibexa.co Gunnstein Lye
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h