[MGNLUI-3815] i18n & MultiValueFieldFactory Created: 17/Mar/16  Updated: 08/Mar/21  Resolved: 08/Mar/21

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

Type: Bug Priority: Neutral
Reporter: Roman Kovařík Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLUI-1548 Remove/inline FormItem and related su... 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: depending issues

 Description   

If you don't set a label property on the nested field, info.magnolia.ui.form.field.definition.FieldDefinitionKeyGenerator#keysFor fails with NPE since the name of the field is not set. To reproduce:

  1. /tours/dialogs/components/tourTypeTeaserRow.yaml Remove the label property of the field
  2. Open tourTypeTeaserRow dialog on the home page.
    Caused by: java.lang.NullPointerException
    	at info.magnolia.ui.form.field.definition.FieldDefinitionKeyGenerator.keysFor(FieldDefinitionKeyGenerator.java:64)
    	at info.magnolia.ui.form.field.definition.FieldDefinitionKeyGenerator.keysFor(FieldDefinitionKeyGenerator.java:55)
    
  1. info.magnolia.ui.form.field.definition.MultiValueFieldDefinition#getButtonSelectAddLabel/getButtonSelectRemoveLabel should be annotated with @I18nText so we can use auto generated keys.
  2. Then the translation in info.magnolia.ui.form.field.factory.MultiValueFieldFactory#createFieldComponent should go away.

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