<cms:out inherit="true"> does not work with <cms:includeTemplate
contentNode="..."> set
---------------------------------------------------------------------------------------
Key: MAGNOLIA-1275
URL: http://jira.magnolia.info/browse/MAGNOLIA-1275
Project: Magnolia
Issue Type: Bug
Components: taglibs
Reporter: Daniel Bleisteiner
Assigned To: Fabrizio Giustina
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) != null!
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...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia.info/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------