-
Bug
-
Resolution: Fixed
-
Low
-
None
-
6.2
-
None
If you set into two select field options the same value, the dialog does not open.
I admit its a rare case, but its still a bug and I can imagine use cases where this is needed.
The reason for the error is in:
SelectFieldFactory line 149 that is uses the options value as being the item ID in the data container optionContainer:
Object value = DefaultPropertyUtil.createTypedValue(fieldType, option.getValue());
Item item = optionContainer.addItem(value);
I created a patch, I think the SelectOptionDefinition name is the better value, as its for sure unique:
SelectFieldFactory.patch
I delegated to a method info.magnolia.ui.form.field.factory.SelectFieldFactory.determinateBestItemName(SelectFieldOptionDefinition) to determine the best name, in some cases the name is null. Maybe a better determination can be found for production code.
Acceptance criteria