Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-8176

ContentType SubModel: 'nodeType' of subModel is ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Neutral Neutral
    • 6.3.0
    • 6.2.34
    • content types
    • None

      Tested:

      On current 6.2.2-SNAPSHOT

      Situation

      In documentation it  stated, that also subModels can have a nodeType:
      https://documentation.magnolia-cms.com/display/DOCS62/Content+type+Model+definition#ContenttypeModeldefinition-Modeldefinitionproperties

      A subdefinition item configuring a complete submodel. Its definition interface is SubModelDefinition.
      A submodel has the same properties as a model, but a submodel cannot have additional submodels.
      If nodeType is not provided, the mgnl:contentNode is still used by default.

      Problem

      Using 'nodeType" in Sub_models are ignored -> the node type is always mgnl:contentNode

      Test

      Using this code: 

      datasource:
        workspace: events
        namespaces:
          mt: https://www.magnolia-travel.com/jcr/1.0/mt
        autoCreate: true
      
      model:
        nodeType: event
        properties:
          - name: location
          - name: descripion
            type: richText
            required: true
          - name: eventType
            required: true
            options:
              - name: workEvent
                value: workEvent
                label: Work Event
              - name: holiday
                value: holiday
                label: Holiday
              - name: familyEvent
                value: familyEvent
                label: Family Event
              - name: other
                value: other
                label: Other
          - name: date
            required: true
            type: Date
          - name: imageLink
            required: true
            type: asset
          - name: contacts
            type: contactData
            multiple: true
          - name: addressess
            type: addressData
            multiple: true
            
        subModels:
          - name: contactData
            nodeType: eventContact
            properties:
              - name: firstName
              - name: familyName
              - name: email
              - name: phoneNumber
              - name: mobileNumber
          - name: addressData
            nodeType: eventAddress
            properties:
              - name: street
              - name: city
              - name: postalCode
              - name: country
      

       

      Results in:

        Acceptance criteria

              rdhar Rishab Dhar
              cringele Christian Ringele
              DeveloperX
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Work Started:

                  Bug DoR
                  Task DoD