[MAGNOLIA-2074] IncludeTemplate Tag renders contentNodes twice Created: 25/Feb/08  Updated: 23/Jan/13  Resolved: 13/Mar/08

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: 3.5.4
Fix Version/s: 3.5.5

Type: Bug Priority: Major
Reporter: Jürgen Hirt Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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   

If the Tag "includeTemplate" has the attribute "contentNodeName" as well as the attribute "path",
the content is rendered twice:

1) the standard template for the contentNodeName is used

2) then the template of the attribute "path" is used

example:
<cms:includeTemplate contentNodeName="headlineWithRichText" path="../../../paragraphs/teasers/headline_with_rich_text.jsp"/>

In my opinion, only one template should be used:
if there's a path attribute, take the template of the path attribute, otherwise take the standard template of the contentNode

When I look into the code of the File Include.java, there's following lines of code:

if (this.path!=null)
{
// TODO
log.warn("You are using the deprecated path attribute of the include tag. Your jsp will be included for now, but you might want to update your code to avoid bad surprises in the future.");
pageContext.include(this.path);
}

ParagraphRenderingFacade.getInstance().render(content, pageContext.getOut(), pageContext);

Wouldn't it be more correct to put the last line into the else branch of that if clause ?



 Comments   
Comment by Jürgen Hirt [ 04/Mar/08 ]

I changed the priority to critical, because we need a solution for that soon, in order to have correct rendering in the current project for our customer !

Comment by Magnolia International [ 13/Mar/08 ]

This seems reasonable but in the meantime:

  • as the tld mentions, about the path attribute: this is deprecated: just use basic jsp (i.e. <jsp:include/>) tags if you need to include a jsp in your templates.
  • increasing the priority and asking for urgent solutions here will not help you
Comment by Magnolia International [ 13/Mar/08 ]

fixed on svn - thanks for the report !

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