[MAGNOLIA-3007] PageIterator tag wrongly iterates on main content instead of current Created: 14/Jan/10  Updated: 23/Jan/13  Resolved: 14/Jan/10

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 4.2, 4.2.1, 4.2.2, 4.1.4, 4.2.3
Fix Version/s: 4.3, 4.2.4

Type: Bug Priority: Major
Reporter: Fabrizio Giustina Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
is causing MAGNOLIA-3209 pageIterator no longer works unless t... Closed
relation
is related to MAGNOLIA-2851 PageIterator tag wrongly iterates ove... 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   

PageIterator tag has been modified for the issue MAGNOLIA-2851 but the change break its common usage.
MAGNOLIA-2851 says "PageIterator tag wrongly iterates over children of the current paragraph instead of the page" but the change does something pretty different: instead of iterating on the current content it iterates always on the main content (the page corresponding to the url).

This totally breaks its common usage (which is identical for other tags). For example we were used to draw a site map by doing:

     <cms:loadPage path="/my/homepage" />
          <cms:pageIterator>

in the past pageIterator was correctly iterating through pages into "/my/homepage", after upgrating to 4.2 now it always iterates on subpages of the current page/url. This also means there is no way to nest pageIterator tags for iterating on children of children and so on...

So the current code was definitively more similar to the old one (except for the deprecate Resource class usage):

    private void initContentIterator() {
        Content activePage = MgnlContext.getAggregationState().getCurrentContent();

instead of

    private void initContentIterator() {
        Content activePage = MgnlContext.getAggregationState().getMainContent();


 Comments   
Comment by Fabrizio Giustina [ 14/Jan/10 ]

changed as described and added an unit test

Comment by Magnolia International [ 14/Jan/10 ]

This has been committed to trunk, so fix version is 4.3

Comment by Fabrizio Giustina [ 14/Jan/10 ]

right, I've also applied the bugfix on the 4.2 branch now. Is 4.2.x ok or you need to create a 4.2.4 in jira?

Comment by Magnolia International [ 14/Jan/10 ]

Fabrizio - no it's fine; as long as the issue mentions in which branches (i.e which fix versions) it's been fixed, it's fine. Once/if we plan to release 4.2.4, we'll add it in jira and update the issues accordingly.

Thanks !

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