[MGNLUI-3608] CompositeTransformer is adding basePropertyName to the property name, resulting in incorrect properties Created: 28/Sep/15  Updated: 15/Apr/16  Resolved: 07/Oct/15

Status: Closed
Project: Magnolia UI
Component/s: forms
Affects Version/s: 5.4.2
Fix Version/s: 5.4.3

Type: Bug Priority: Critical
Reporter: Jordie Diepeveen Assignee: Evzen Fochr
Resolution: Fixed Votes: 1
Labels: support
Remaining Estimate: 0d
Time Spent: 4h 40m
Original Estimate: Not Specified

Issue Links:
causality
caused by MGNLUI-3508 Streamline form field attributes hand... Closed
is causing MTE-46 Link component is adding 'linkType' a... Closed
duplicate
is duplicated by MGNLUI-3611 Link list is broken due to changes in... 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
Date of First Response:
Sprint: Kromeriz 13
Story Points: 2

 Description   

Somehow, when using the SwitchableFieldDefinition (link from the MTE), the properties are stored incorrect. The LinkModel from the MTE cannot read the correct properties and no link and title are shown.

It seems to be in the CompositeTransformer#getCompositePropertyName() method.
The field definition is i18n, so the propertyName (linkTypeexternal) will be appended by the basePropertyName ('linkType'). This results in the field 'linkTypeexternallinkType'.

See issue MTE-46.


More info from duplicate (and closed) issue.

Due to incomplete implementation of property name generation, info.magnolia.ui.form.field.transformer.composite.SwitchableTransformer now prepends (parent's) fieldname once more resulting in wrong and unexpected property names, also see protected String definePropertyName() and protected String deriveLocaleAwareName(String).

Instead of:

linkType=internal
linkTypeinternal=acc832d1-4302-4812-a13d-b7446d302dfe

it creates

linkTypelinkType=internal
linkTypeinternallinkType=acc832d1-4302-4812-a13d-b7446d302dfe

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