[MGNLUI-4242] Edit the sub-beans with the composite fields is not possible for null attributes in beans Created: 07/Jul/17  Updated: 08/Mar/21  Resolved: 08/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: forms
Affects Version/s: 5.5.4, 5.5.5
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Mercedes Iruela Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
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:

 Description   

When you try to edit subbeans using a composite field it has not effect for bean's attributes that are not initialized (i.e. attribute = null).

It seems to be related to this code in info.magnolia.ui.form.field.AbstractCustomMultiField.createLocalField(FieldDefinition, Property<?>, boolean):

 // If the value property is not an Item but a property, set this property as datasource to the field
// and add a value change listener in order to propagate changes
        if (!holdsItem(property)) {
            if (property != null && property.getValue() != null) {
                field.setPropertyDataSource(property);
            }
            field.addValueChangeListener(selectionListener);
        }

When the value of the bean attribute is null, setPropertyDataSource is not set to property. So for the attributes that are not null have set correctly the datasource method pointing to the Bean and can be edited, but the attributes that are null are pointing to a transformer and edition has not effect.



 Comments   
Comment by Roman Kovařík [ 08/Mar/21 ]

Closing this as M5.5 has reached EOL https://docs.magnolia-cms.com/product-docs/Support/End-of-life-policy.html

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