Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.0
-
None
Description
When the code macro result is computed asynchronously (the default, codecached.async=true), the relative references found in the title and image parameters are resolved against Main.WebHome instead of the page containing the macro. So the first time the page is displayed (before the result is cached), the links and images in the box title point to the wrong page.
Steps to reproduce
- Create a page Sandbox.Test with the following content:
{{code title="See [[Child]] and [[attach:file.txt]]" image="pic.png" language="none"}}some content{{/code}} - View the page (first view, the macro is rendered asynchronously)
Result
- The image points to /xwiki/bin/download/Main/WebHome/pic.png
- The Child link points to /xwiki/bin/create/Main/Child/WebHome?parent=Main.WebHome
- The attachment link points to /xwiki/bin/download/Main/WebHome/file.txt
Expected
The references are resolved relative to the page containing the macro, i.e. /xwiki/bin/download/Sandbox/Test/WebHome/pic.png, etc.
Once the result is cached, the next views are correct, since the cached blocks are then rendered by the page itself.
The reason is that the asynchronous job is executed without any context document.
Attachments
Issue Links
- is related to
-
CODECACHE-6 Links to missing pages in the title parameter have Main.WebHome as parent when the code macro is rendered asynchronously
-
- Closed
-
- relates to
-
CODECACHE-3 Wrong or outdated code displayed when the content of the code macro or of the content before it is dynamic
-
- Closed
-