Uploaded image for project: 'Cached Code Macro'
  1. Cached Code Macro
  2. CODECACHE-6

Links to missing pages in the title parameter have Main.WebHome as parent when the code macro is rendered asynchronously

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.1
    • 1.0
    • None
    • Unit
    • Unknown

    Description

      When the code macro result is computed asynchronously (the default, codecached.async=true), a link to a missing page in the title parameter points to the right page creation URL but with parent=Main.WebHome instead of the page containing the macro. So, the first time the page is displayed (before the result is cached), a page created from that link gets Main.WebHome as parent.

      Steps to reproduce

      • Create a page Sandbox.Test with the following content:
        {{code title="See [[Child]]" language="none"}}some content{{/code}}
        
      • View the page (first view, the macro is rendered asynchronously)

      Result

      The link points to /xwiki/bin/create/Sandbox/Test/Child/WebHome?parent=Main.WebHome

      Expected

      The link points to /xwiki/bin/create/Sandbox/Test/Child/WebHome?parent=Sandbox.Test.WebHome, as it does once the result is cached.

      The reason is that the parent parameter is computed from the context document, and the asynchronous job is executed without any context document. CODECACHE-5 fixed the link target itself.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: