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

<cms:out inherit="true"> does not work with <cms:includeTemplate contentNode="..."> set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • taglibs
    • None

      I'm using <cms:includeTemplate contentNode="..."> to include templates which use <cms:out inherit="true"> themself. That inherit="true" does not work in that case. Only local properties are printed - parent node's properties are not found. This issue is related to MAGNOLIA-1272 and should affect all cases where Resource.getLocalContentNode(request) Unable to render embedded object: File (= null) not found.

      As far as I have analyzed this issue the problem lies in BaseContentTag#resolveNode(Content)! This method uses a local variable currentParagraph. If this variable != null (in case of a local conent node) and no contentNodeName or contentNodeCollectionName is set it simply returns the local content node referenced by currentParagraph. It never returns the node with the property we are looking for.

      if (contentNodeName == null && contentNodeCollectionName == null)

      { // e.g. <cms:out nodeDataName="title"/> return currentParagraph; }

      To come back to my problem... the following code in BaseContentTag#getFirstMatchingNode() never returns the desired node because it won't be returned by resolveNode(Content):

      while (inherit && currentPage.getLevel() > 0 && !nodeData.isExist())

      { currentPage = currentPage.getParent(); contentNode = resolveNode(currentPage); nodeData = contentNode.getNodeData(this.nodeDataName); }

      The contentNode stays the local content node all over the while loop and is returned in the end.

      That's all for the moment... I'll try to solve this for my local installation and report my changes later... but I don't have the total overview of possible sideeffects. We'll see that I can do...

        Acceptance criteria

              fgiust Fabrizio Giustina
              da3x Daniel Bleisteiner
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD