Details
-
Bug
-
Resolution: Fixed
-
High
-
1.7.6, 1.13.0
-
None
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
Issue Links
- discovered while testing
-
EZP-28258 Can't publish/save content with missing Selection option
- Closed