-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Describe the bug
When using MakeReadOnly on an editor field and expecting a max value of one item, if the provided format function returns a string containing a comma (,), the Entity Picker UI misbehaves. Specifically, the picker treats the formatted string as if it contains multiple values. This results in the validation error: This field exceeds the allowed amount of items even though only a single entity is selected.
Steps To Reproduce
Steps to reproduce the behavior:
- Configure a field with .MakeReadOnly(context => context.EditorMode == EditorMode.Edit, x => $"{x.SomeProperty}, {x.OtherProperty}") (note the comma in the formatted string).
- Open the editor for an entity where the field is read-only.
3.Observe that the read-only value renders with the comma in the label.
4.Attempt to save the entity.
The UI shows the error “This field exceeds the allowed amount of items”, despite only one item being selected.
Expected behavior
The format function should be treated as a single display string. Commas inside the formatted value should not be interpreted as multiple items, and the picker should allow saving without error.
Environment (please complete the following information):
Umbraco CMS: 15.4.4
UI Builder: 15.1.9
Additional context
Removing the comma from string before sending it off resolves the issue, but I would love to see if this could be resolved.
Thanks!!!!
This item has been added to our backlog AB#56646