Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
6.2.11
-
None
-
Empty show more show less
-
Yes
-
UI Maintenance 1, UI Maintenance 2
-
5
Description
Steps to reproduce
- Create a multiValue which has 18n enable, like this:
myDialog.yaml
label: Events List form: properties: events: $type: jcrMultiField i18n: true label: Events itemProvider: $type: jcrChildNodeProvider field: $type: compositeField properties: title: label: title $type: textField date: label: date $type: dateField
- Create the component
- Save data only in English
- Check at JCR that a mgnl:contentNode (empty) has been created for all available languages
Expected results
Only those nodes of language to which was switched are created. Node for default language is created every time.
Actual results
For each language, a mgnl:contentNode is created, even if the user didn't create (add) any field at the dialog for that language
Workaround
Use the old UI dialog definition (for this case, if you use this you can check the behavior):
form:
tabs:
- name: tabText
label: Multivalue composite
fields:
- name: events
fieldType: multiValue
i18n: true
label: Events
transformerClass: info.magnolia.ui.form.field.transformer.multi.MultiValueSubChildrenNodePropertiesTransformer
field:
name: compositeField
fieldType: composite
transformerClass: info.magnolia.ui.form.field.transformer.composite.NoOpCompositeTransformer
fields:
- name: title
fieldType: text
label: Title
- name: date
fieldType: date
label: Date
actions:
commit:
class: info.magnolia.ui.admincentral.dialog.action.SaveDialogActionDefinition
cancel:
class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition
Development notes
On Magnolia 5.7, only those fields which had been added to a language were saved, otherwise they weren't created (please check the attachments)
This behavior affects on first place to performance for users which have lots of languages enabled on a site and, on second place, if working with nodes/delivery api. On that second case, if you perform a REST call to get the nodes for that component you may get (following the Events example) that there are 10 events in 10 different languages when really only English has events and the other 9 are empty nodes that were created because this bug.