Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
5.5.2, 6.2.11
-
-
Empty show more show less
-
Yes
-
Yes
-
Nucleus 1, Nucleus 2
-
3
Description
Various fields create mutli-value properties (TwinColum etc).
So there is the need to be able to create mutli-value property also over the area's auto creation.
Here we run into a bug:
For creating a multi-value property one needs to pass a List into the property creation.
But when defining a List in yaml, it is provided as a HashMap (LinkedHashMap) and not as a List.
So the code expects that a sub-strucutre of node should be created -> HashMaps are used for defining sub-node strucutres.
Here form here info.magnolia.rendering.generator.CopyGenerator.createNode(Node, Map<String, Object>):
// a sub content if (property.getValue() instanceof HashMap) { Map<String, Object> map = new HashMap<String, Object>(); map.put(propertyName, value); createNode(newNode, map); } else { PropertyUtil.setProperty(newNode, propertyName, value); }
The code will go into "if" and not "else" as a HashMap is returned.
Problem:
Defining in Yaml such Lists will be retruned as HAshMap:
food: - Sandwich - Pizza - Burrito - Chocolate cake
Also this type of List:
drinks: [coke, beer, water, milk]
Checklists
Attachments
Issue Links
- relates to
-
MGNLFORM-362 FormFieldModel fails if invoked via autogeneration
-
- Closed
-
- to be documented by
-
MAGNOLIA-8291 DOC: Defining multi-value property for component autogeneration
-
- Closed
-