[MGNLUI-6831] IdentifierToPathConverter#convertToPresentation locale null and not changing Created: 16/Aug/21  Updated: 20/Aug/21

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

Type: Bug Priority: Neutral
Reporter: Samuli Saarinen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

java 11
magnolia 6.2.11


Issue Links:
causality
caused by MGNLUI-6501 Language selector shows wrong initial... 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
Visible to:
Samuli Saarinen

 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


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