[MAGNOLIA-2806] contentNodeIterator tag doesn't inherit content Created: 01/Jul/09  Updated: 23/Jan/13  Resolved: 07/Aug/09

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: 4.1, 4.0.2
Fix Version/s: 4.0.3, 4.1.1

Type: Bug Priority: Major
Reporter: Thomas Duffey Assignee: Jan Haderka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File BaseContentTag.java.inherit.patch     Text File ContentNodeIterator.java.inherit.patch     Text File ContentNodeIteratorTests.java.inherit.patch    
Issue Links:
relation
is related to MAGNOLIA-2669 <cms:out inherit="true" fails Closed
supersession
is superseded by MAGNOLIA-2869 taglibs: inheritance in iterator and ... Closed
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   

When you set inherit="true" on the content node iterator tag it does not inherit content from ancestor pages.



 Comments   
Comment by Thomas Duffey [ 02/Jul/09 ]

Patch to ContentNodeIterator.getCollection() to use parent getFirstMatchingNode() method which handles inheriting from ancestor pages

Comment by Thomas Duffey [ 02/Jul/09 ]

Patch to BaseContentTag.resolveNode(Content currentPage) to use supplied currentPage instead of the local content node to handle searching through ancestor pages

Comment by Thomas Duffey [ 02/Jul/09 ]

Please review two attached patches. There are a lot of different conditional cases involved that I do not fully understand but this handled one test case I am working on doing something like:

<cms:contentNodeIterator contentNodeCollectionName="adBox" inherit="true">
. ...
</cms:contentNodeIterator>

where I expect the inherit="true" attribute to look for the content in ancestor pages.

Unfortunately, this breaks some test cases because apparently the use of BaseContentTag.getFirstMatchingNode() requires the [config] repository to be setup. I am trying to add this capability to the tests and will submit another patch for them if I can figure it out.

Comment by Thomas Duffey [ 02/Jul/09 ]

Patch to make test case work along with the other patches in this issue

Comment by Thomas Duffey [ 28/Jul/09 ]

Note that the ContentNodeIterator patch is solid – you definitely need to use getFirstMatchingNode() for inherit to work.

The patch to BaseContentTag is most likely a hack that only worked for my current scenario. I believe a better solution may be found in MAGNOLIA-2669

Comment by Jan Haderka [ 07/Aug/09 ]

BaseContentTag patched by changes made for MAGNOLIA-2669.
Applied the rest. Thanks for patches.

Generated at Mon Feb 12 03:40:17 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.