[MAGNOLIA-3209] pageIterator no longer works unless the current node is a page Created: 21/May/10 Updated: 23/Jan/13 Resolved: 21/May/10 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 4.3, 4.3.1, 4.2.4 |
| Fix Version/s: | 4.3.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Nickolaus Wing | Assignee: | Philipp Bärfuss |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Template: |
|
||||||||||||||||
| Patch included: |
Yes
|
||||||||||||||||
| 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
|
||||||||||||||||
| Description |
|
This is related to Content activePage = MgnlContext.getAggregationState().getCurrentContent(); This means that if you use the tag while a non-page content node is active, it will come up blank. That struck me as very odd when I ran across it. It seems more appropriate to change it to this: Content activePage = MgnlContext.getAggregationState().getCurrentContent(); try { while (!activePage.getItemType().equals(ItemType.CONTENT)) { activePage = activePage.getParent(); } } catch (Exception e) { // oh well } This will search up the tree until we find the page we're on, then iterate over its subpages. The try/catch is there because getParent() can throw JCR exceptions. |