Details
-
Bug
-
Resolution: Outdated
-
Minor
-
None
-
3.5.3, 3.5.4
-
None
-
Windows XP, Java 1.5, Tomcat 5.5.25
Description
The following code doesn't work. It causes a NullPointException :
<cms:contentNodeIterator items="${sectionArticles}"> <cms:includeTemplate /> <% Content parent = Resource.getLocalContentNode().getAncestor(3); %> <p class="blogline blogfoot"><span class="blogitem">Rubrique: <a href="<%= request.getContextPath() + parent.getHandle()+".html"%>"><%= parent.getTitle() %></a></span></p> </cms:contentNodeIterator>
It appears that Resource.getLocalContentNode() returns null when call after a <cms:includeTemplate /> tag because the following code works fine:
<cms:contentNodeIterator items="${sectionArticles}"> <% Content parent = Resource.getLocalContentNode().getAncestor(3); %> <cms:includeTemplate /> <p class="blogline blogfoot"><span class="blogitem">Rubrique: <a href="<%= request.getContextPath() + parent.getHandle()+".html"%>"><%= parent.getTitle() %></a></span></p> </cms:contentNodeIterator>
Checklists
Acceptance criteria