[MGNLUI-8176] ContentType SubModel: 'nodeType' of subModel is ignored Created: 12/Jul/23  Updated: 19/Jul/23  Resolved: 19/Jul/23

Status: Closed
Project: Magnolia UI
Component/s: content types
Affects Version/s: 6.2.34
Fix Version/s: 6.3.0

Type: Bug Priority: Neutral
Reporter: Christian Ringele Assignee: Rishab Dhar
Resolution: Done Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File SubModel-NodeType.png    
Issue Links:
Cloners
clones MGNLUI-6010 ContentType SubModel: 'nodeType' of s... Closed
relation
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-8177 Implementation Sub-task Completed Rishab Dhar  
MGNLUI-8178 Review Sub-task Completed Javier Benito  
MGNLUI-8179 Pre-Integration QA Sub-task Completed Javier Benito  
MGNLUI-8180 QA Sub-task Completed Milan Divilek  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Epic Link: Support
Sprint: DevX 41, DevX 42
Story Points: 3
Team: DeveloperX
Work Started:
Approved:
Yes

 Description   

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:


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