Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-6099

Be more lenient regarding value type when auto-converting legacy definitions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Neutral
    • 6.2.3
    • None
    • None

    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.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                rkovarik Roman Kovařík
                rgange Richard Gange
                Votes:
                4 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - Not Specified
                      Not Specified
                      Logged:
                      Time Spent - 26m
                      26m