[MAGNOLIA-1275] <cms:out inherit="true"> does not work with <cms:includeTemplate contentNode="..."> set Created: 15/Dec/06 Updated: 04/Nov/15 Resolved: 04/Nov/15 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | taglibs |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Bleisteiner | Assignee: | Fabrizio Giustina |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
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 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... |
| Comments |
| Comment by Daniel Bleisteiner [ 15/Dec/06 ] | |
|
I'd use the following solution: 1st search from the local content node upwards if set - not the request page! Here is my local patch... please have a closer look. I found no reason why the original return within resolveNode returns the local content node - it has nothing to do with the currentPage parameter given. But I could oversee some other sideeffects - maybe there is another reoson for returning that local content node instead of the given currentPage parameter. Index: /home/daniel/Software/magnolia/magnolia-taglib-cms/src/main/java/info/magnolia/cms/taglibs/BaseContentTag.java HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
| |
| Comment by Michael Mühlebach [ 04/Nov/15 ] | |
|
Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes. |