[MAGNOLIA-2671] <cmsu:simpleNavigation relativeLevels="true" fails Created: 24/Mar/09  Updated: 23/Jan/13  Resolved: 11/Dec/09

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: 4.0.1, 4.1.1
Fix Version/s: 4.1.3, 4.2.2

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

Windows Vista Business SP1
JDK 1.6.0_11
apache-tomcat-5.5.26
magnolia-bundled-webapp-4.0.1.war


Issue Links:
relation
is related to MAGNOLIA-2431 taglibs: contentNodeIterator must sav... Closed
is related to MAGNOLIA-2669 <cms:out inherit="true" fails Closed
is related to MAGNOLIA-2972 Bug in simpleNavigation introduced in... 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   

After upgrading from Magnolia 3.6.3 to 4.0.1, the tag <cmsu:simpleNavigation relativeLevels="true" startLevel="0" endLevel="1" /> does not print out the list of subpages anymore.

Like with MAGNOLIA-2669, the problem seems to be caused by the changes for MAGNOLIA-2642 as it disappears for me when I revert Resource.java to the previous revision from http://svn.magnolia-cms.com/view/community/magnolia/trunk/magnolia-taglib-cms/src/main/java/info/magnolia/cms/taglibs/Resource.java?revision=21024



 Comments   
Comment by Oliver Knorr [ 07/Nov/09 ]

I just had a fresh look at this, now with Magnolia 4.1.1, where the problem still exists. I tried to find a new fix without reverting to the old Resource.java version.

It obviously has to do with the single usage of the Resouce class in SimpleNavigationTag, which is the first line inside the doEndTag() method:

    public int doEndTag() throws JspException {
        Content activePage = Resource.getCurrentActivePage();

The problem disappeared for me, when I replaced getCurrentActivePage() with getActivePage(), like this:

    public int doEndTag() throws JspException {
        Content activePage = Resource.getActivePage();

I'm still a bit wary of suggesting this as a patch, as I don't know what the difference between getCurrentActivePage() and getActivePage() is supposed to be. Except for a deprecation notice, the Javadoc for the two methods is identical...

Comment by Jan Haderka [ 25/Nov/09 ]

Let me guess: the issue actually occurs only when the tag is in the template after the cms:contentNodeIterator, but if you move the cmsu:simpleNavigation before the iterator, the issue will not occur. Is that correct?

Comment by Oliver Knorr [ 27/Nov/09 ]

Hello Jan,
I just tried this, and you are right! To be more precise, the problem exists, if the cmsu:simpleNavigation is nested insided the cms:contentNodeIterator tag (in my case, it's part of a special paragraph). If I put the same cmsu:simpleNavigation before the opening tag of cms:contentNodeIterator or after its closing tag, it works fine.

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