Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-4220

renderConfluenceMacro seems to render content "out-of-context"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Medium
    • None
    • 1.4.3
    • None

    Description

      Using the workaround for rendered User-Macros as proposed in CONF-3887 and CONF-2293 there comes up a new issue: renderConfluenceMacro won't render the Wiki-Content in the current context. So the following macro will produce two different results:

      User Macro:
      ------------------------------
      #set($wiki="

      {blog-posts:3|content=titles}")
      #set($globalHelper=$action.getGlobalHelper())
      #set($renderer=$globalHelper.getWikiStyleRenderer())
      #set($context=$content.toPageContext())
      #set($xhtml1=$renderer.convertWikiToXHtml($context, $wiki))
      #set($xhtml2=$globalHelper.renderConfluenceMacro($wiki))
      <dl>
      <dt>Version 1</dt>
      <dd>${xhtml1}</dd>
      <dt>Version 2</dt>
      <dd>${xhtml2}</dd>
      </dl>
      ----------------------------

      While Version 1 correctly lists the news of the current space Version 2 renders the {blog-posts}

      -macro as if it got previewed in a Global Template, i. e. at least not with the News of the current space. It would be great if renderConfluenceMacro would render this correctly as the rendered macros will then shrink to:

      #set($wiki=$body)
      #set($globalHelper=$action.getGlobalHelper())
      #set($xhtml=$globalHelper.renderConfluenceMacro($wiki))
      ${xhtml}

      instead of

      #set($wiki=$body)
      #set($globalHelper=$action.getGlobalHelper())
      #set($renderer=$globalHelper.getWikiStyleRenderer())
      #set($context=$content.toPageContext())
      #set($xhtml=$renderer.convertWikiToXHtml($context, $wiki))
      ${xhtml}

      which in addition produces a failure when previewed in the Global Templates.

      Attachments

        Activity

          People

            Unassigned Unassigned
            2f5ffb0094a7 Mark Michaelis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: