-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.1.20 EE GA2, 6.2.X EE, 7.0.0 M3
-
Fix Version/s: 6.1.X EE, 6.2.2 CE GA3 , 6.2.X EE
-
Component/s: Documents & Media, Documents & Media > Administration
-
Branch Version/s:6.2.x, 6.1.x
-
Backported to Branch:Committed
-
Story Points:4
-
Fix Priority:3
-
Git Pull Request:
We can not create a select field with empty option or empty value.
steps to reproduce
- Start portal
- Navigate Control Panel > Documents and Media
- Click on Manage > Document Types
- Drag and drop a Select field to the Main Metadata Fields
- Configure this field
- It has 3 options, clear the first option's value or clear the first option's text
- click on save
expected behaviour
A select box with the first option's text empty or the first option's value empty
experienced behaviour
The option will be deleted
root cause
Alloy UI, aui-datatable-edit.js - saveOptions:
names.each(function(inputName, index) { var name = inputName.val(); var value = values.item(index).val(); if (name && value) { options[value] = name; } });
See the if (name && value). So the value is stored in options[] only when value is not empty. It should be changed to name || value