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

Original previewMode is forgotten when Exception in Paragraph

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 4.4.2
    • rendering, templating
    • None

    Description

      When I use noEditBars="true" and the Paragraph throws an Exception all paragraphs afterwards get no edit-bar.

      I found that the last part that restores the previewMode is not run when an Exception is thrown in this code.

                 if(noEditBars && !orgShowPreview){
                     aggregationState.setPreviewMode(true);
                 }
      
                 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);
                 } else {
                     WebContext webContext = MgnlContext.getWebContext();
                     webContext.setPageContext(pageContext);
      
      webContext.push((HttpServletRequest)pageContext.getRequest(),
      (HttpServletResponse)pageContext.getResponse());
                     try {
                         renderingEngine.render(content, pageContext.getOut());
                     } finally{
                         webContext.pop();
                         webContext.setPageContext(null);
                     }
                 }
                 if(noEditBars){
                     aggregationState.setPreviewMode(orgShowPreview);
                 }
      

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                kimmo Kimmo Björnsson
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD