| 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. |