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

Control of dependencies between CTs (within one module)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 5.7.2, 6.0
    • None
    • None
    • None

    Description

      The loading order of content type definitions (CTs) within one module seems unpredictable.
      This leads to problems, when one CT has relations to other CTs (=> a property of a CT points to another CT), If the loading order is unfavorable.

      Probably it would be more precise to say:
      The Loading order of CTs and CT based apps of the same module is unpredictable, this leads to not properly "initialized" (registered) apps, if there are relations between its CTs.
      However - on this ticket we should focus on CTs only.

      While developing the CTs (and its apps), adding definitions step by step, one by one, there is no problem.
      But on start-up of an instance with a module with multiple CTs with relations, most probably not all CTs are properly "initialized".

      Work arounds

      1. On the running system, touch the CT def. files in the "proper" order. ... or ...
      2. Create distinct modules, one module with only one CT and its related (CT based) app; define load order with dependencies in module.yaml.

      Example
      3 CTs in one app: tourVehicle, tourGuide, tourOffices
      Tour-offices may have links to both tour-vehicles and tour-guides.
      The Tour-office app, when showing an item, cannot properly "resolve" / show the linked items.
      (To reproduce, e.g. use https://git.magnolia-cms.com/users/cmeier/repos/content-type-examples).
      See attached screenshot for not properly displayed linked items. 

      Discussion
      1st workaround is not an option on prod. system.
      2nd workaround is doable but quite a restriction.
      I would prefer a solution where "the system is clever enough to load in correct order" ... if the system can figure out this ... or if the system could be instructed via config somehow ... or to quote Mika:

      content-types could/should build a mini, CT-specific, dependency-graph

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                mgeljic Mikaël Geljić
                cmeier Christoph Meier
                Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Time Spent - 0.75d Remaining Estimate - 0.25d
                      0.25d
                      Logged:
                      Time Spent - 0.75d Remaining Estimate - 0.25d
                      0.75d