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

fix hack related to MAGNOLIA-2186 and MAGNOLIA-923

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.0
    • 4.0
    • core, templating

    Description

      I encountered a bug when using tags (of the Tag sort, SimpleTags work fine) in paragraph templates. Somehow the writer of the pageContext gets lost, and freemarker does not like it: from TagTransformModel:

                  if(out instanceof JspWriter) {
                      if(out != pageContext.getOut()) {
                          throw new TemplateModelException(
                             "out != pageContext.getOut(). Out is " +
                              out + " pageContext.getOut() is " +
                              pageContext.getOut());
                      }
                      usesAdapter = false;
                  } else {
                      out = new JspWriterAdapter(out);
       // etc...
      

      There are multiple approaches:

      • currently, the include tag passes the pageContext.getOut to the paragraph renderer. This trigger the if block above. Include tag could wrap the JspWriter in a regular writer. This is how I fixed it with r18328
      • fixing freemarker by omiting this if block - I'll contact the developers to try and understand what the reasoning is
      • figure out a way to not loose the pageContext/writer when rendering paragraphs. I'm pretty unsure how that happens as of now.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                gjoseph Magnolia International
                gjoseph Magnolia International
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD