[MGNLUI-6099] Be more lenient regarding value type when auto-converting legacy definitions Created: 19/Jun/20  Updated: 13/Aug/20  Resolved: 13/Aug/20

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

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Roman Kovařík
Resolution: Done Votes: 4
Labels: 622
Remaining Estimate: Not Specified
Time Spent: 26m
Original Estimate: Not Specified

Attachments: PNG File form-dialog.png    
Issue Links:
Relates
relates to MGNLFORM-320 Static field converter Closed
duplicate
is duplicated by MGNLUI-6052 OptionGroupFieldDefinition not workin... Closed
relation
is related to MGNLFORM-318 Validator names in form fields unread... 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
Epic Link: UI framework: migration and backwards compatibility
Sprint: UI FW 8
Story Points: 5

 Description   

As described below it could be a case that e.g. a select field had a value type configured as Long, however, no converter specified. The underlying JCR back-end would handle that correctly (would convert select's internal string value to Long and would store it appropriately). 6.2 fields have a similar logic actually (see JcrItemPropertySet implementation), but we still bail out from attempting to convert such cases in AbstractConfiguredFieldDefinitionConverter:

        if (oldDefinition.getConverterClass() == null && oldDefinition.getType() != null && !oldDefinition.getType().equals(PropertyType.TYPENAME_STRING)) {
            if (!supportsType(oldDefinition.getType())) {
                log.error("No converter set for non-String field:" + oldDefinition.getName() + ": " + oldDefinition.getType());
                return false;
            }
            log.debug(oldDefinition.getType() + " type is used in definition " + oldDefinition.getName() + " without proper converterClass.");
        }

Can we just let it slide if the values are primitives?

The example case:

Option group field conversion is failing in dialogs. To see an example, open the pages app and go to the page /travel/contact. Click the main section, scroll down the page to the email field. Edit the field.


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