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

IdentifierToPathConverter#convertToPresentation locale null and not changing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Neutral
    • None
    • None
    • None
    • None
    • java 11
      magnolia 6.2.11

    Description

      Steps to reproduce

      I have some Magnolia UI5 apps that define link fields as follows:

       

      field:
        name: linkField
        class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
        targetWorkspace: tags
        targetTreeRootPath: /serviceclasses
        appName: tags
        identifierToPathConverter:
          class: x.y.z.magnolia.converters.TagIdentifierToPathConverter
      

       
      after updating from Magnolia 6.2.5 to 6.2.11 the converter started to receive calls to

      convertToPresentation(String tagCode, Class<? extends String> targetType, Locale locale)
      

      with null locale. When accessing the UI the converter gets called multiple times and it seems that locale is null for the first time it is called. Also what differs from prior version is that changing the i18n language does not seem to have effect on the locale that gets passed to convertToPresentation but it's always the default locale (when not null). On 6.2.5 it would be the locale that was selected from the i18n dropdown.

      I tried adding i18n: true on the field definition but it did not have any effect on the issue and I think it should not matter as I'm not trying to store field values for links differently based on languages but only show the link value differently based on selected locale.

      Expected results

      right locale is passed to converter

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                ssaarinen Samuli Saarinen
                Samuli Saarinen
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:

                  Checklists

                    Bug DoR
                    Task DoD