Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6985

Area's auto creation: Creation of multi-value properties is not possible over Yaml

XMLWordPrintable

    • Yes
    • Yes
    • Nucleus 1, Nucleus 2
    • 3

      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]
      

        Acceptance criteria

              thien.quach Quach Hao Thien
              cringele Christian Ringele
              Nucleus
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 6d 7.5h
                    6d 7.5h