Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3007

PageIterator tag wrongly iterates on main content instead of current

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.3, 4.2.4
    • 4.2, 4.2.1, 4.2.2, 4.1.4, 4.2.3
    • None
    • None

      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();
      

        Acceptance criteria

              fgiust Fabrizio Giustina
              fgiust Fabrizio Giustina
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD