This issue has been created
There are 2 updates.
 
 
Cached Code Macro / cid:jira-generated-image-avatar-5b71557e-2c23-47ba-8303-2658f3f046fa CODECACHE-6 Open

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

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-58b226a6-fc2c-4c25-9f48-391a3e0e41ce Vincent Massol created this issue on 12/Nov/26 14:05
 
Summary: Links to missing pages in the title parameter have Main.WebHome as parent when the code macro is rendered asynchronously
Issue Type: cid:jira-generated-image-avatar-5b71557e-2c23-47ba-8303-2658f3f046fa Bug
Affects Versions: 1.0
Assignee: Unassigned
Created: 12/Nov/26 14:05
Priority: cid:jira-generated-image-static-major-f9ca24aa-fafd-4770-adf7-70007562eb6d Major
Reporter: Vincent Massol
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.

 
 

2 updates

 
cid:jira-generated-image-avatar-58b226a6-fc2c-4c25-9f48-391a3e0e41ce Changes by Vincent Massol on 12/Nov/26 14:05
 
Fix Version: 1.1
Assignee: Vincent Massol