Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-14332

Alfresco stops working when Type Hierarchy creates a circular reference

    Details

      Description

      When circular dependency occurs between two or more models which either directly or indirectly depend on each other, the Alfresco server goes into an indefinite loop.

      The attached models depict the following scenario:

      model-B -> model-A (Model-B depends on Model-A)
      model-C -> model-B (Model-C depends on Model-B)

      Therefore, if we update model-A so that it depends on model-C:
      model-A -> model-C (Model-A depends on Model-C)
      Then there is an indirect dependency between model-A and model-C, which leads to circular dependency between the models and causes Alfresco server to stop working.

      Steps to reproduce:

      Upload the attached models into Repository > Data Dictionary > Models, then do the following:

      1. Activate model-A (Click on edit properties and select the “Model Active” checked box)
      2. Activate model-B
      3. Activate model-C
      4. Replace the entire content of model-A (Click on edit properties, then content ) with the following:
        <?xml version="1.0" encoding="UTF-8"?>
        <model xmlns="http://www.alfresco.org/model/dictionary/1.0" name="prefixA:model-A">
            <author>Administrator</author>
            <imports>
                <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
                <import uri="http://www.mycompany.com/model/modelCnamespace/1.0" prefix="prefixC"/>
            </imports>
            <namespaces>
                <namespace uri="http://www.mycompany.com/model/modelAnamespace/1.0" prefix="prefixA"/>
            </namespaces>
            <data-types/>
            <constraints/>
            <types>
                <type name="prefixA:TypeA">
                    <title>Model-A Type A</title>
                    <parent>cm:content</parent>
                    <properties/>
                    <associations/>
                    <overrides/>
                    <mandatory-aspects/>
                </type>
                <type name="prefixA:modelATypeB">
                    <title>Model-A Type B</title>
                    <parent>prefixC:TypeC</parent>
                    <properties/>
                    <associations/>
                    <overrides/>
                    <mandatory-aspects/>
                </type>
            </types>
            <aspects/>
        </model>
        
      5. click Save

      Expected behaviour:
      Circular dependency should be detected.

        Attachments

        1. alfresco.log
          6 kB
        2. alfresco.log
          441 kB
        3. model-A.xml
          0.7 kB
        4. model-B.xml
          0.7 kB
        5. model-C.xml
          0.7 kB

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  jkaabimofrad Jamal Kaabi-Mofrad
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 3 weeks, 5 hours, 30 minutes
                    3w 5h 30m

                      Structure Helper Panel