[MGNLUI-5471] Allow select fields non-string values (i.e. ditch hardcoded conversion of selected item to link) Created: 05/Nov/19  Updated: 03/Nov/21  Resolved: 11/Dec/19

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2

Type: Bug Priority: Neutral
Reporter: Milan Divilek Assignee: Milan Divilek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLUI-5411 Create converters for definition base... Closed
is related to MGNLUI-6936 Unable to convert String to Long in s... Closed
is related to MGNLUI-5510 Providing defaultValue for Switchable... Closed
is related to MGNLUI-5553 Allow to set element type for multi-s... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Sprint: UI Framework 10, UI Framework 11, UI Framework 12
Story Points: 5

 Description   

At the moment, all select fields forcibly convert their selected values to string (reference), effectively preventing themselves from having values of different types.

For example:
info.magnolia.ui.framework.datasource.optionlist.OptionSelectFieldSupport creates itemToLinkConverter which model class is set to String this than cause java.lang.ClassCastException when field type is set to something else (Long etc.)

We can simply eliminate the forced conversion logic and should the item to link conversion happen - it can be configured via field definition. This would simplify the implementation of the LinkField support quite a lot as well.


Generated at Mon Feb 12 09:26:55 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.