This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-494f5d8c-8c4c-4049-a294-0e523b1d063b XWIKI-24650 Open

Dashboard content parsing modifies rendering context

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-e216d57d-4429-43de-9035-c00cf296c521 Michael Hamann created this issue on 31/Jul/26 12:17
 
Summary: Dashboard content parsing modifies rendering context
Issue Type: cid:jira-generated-image-avatar-494f5d8c-8c4c-4049-a294-0e523b1d063b Bug
Affects Versions: 16.10.0
Assignee: Unassigned
Components: Dashboard
Created: 31/Jul/26 12:17
Priority: cid:jira-generated-image-static-major-afed4c34-f2a2-4579-a961-2eb1a17c6b36 Major
Reporter: Michael Hamann
Description:

The gadget renderer executes the gadget content using a ContentExecutor<MacroTransformationContext> which isn't used anywhere else and appears to be duplicating today's MacroContentParser which evolved since the introduction of the content executor. One noticeable difference is that it doesn't use a fresh rendering context which has the following noticeable effect:

Steps to reproduce:

  1. Log in as user with script (can also be admin or programming) right.
  2. Create a document with a dashboard macro nested inside a content macro:
    {{content syntax="xwiki/2.0"}}
    {{dashboard/}}
    {{/content}}
    
  3. Edit the document in "inline form" mode add two gadgets (e.g., of type box) and set the title of each gadget to $xwiki.getCurrentContentSyntaxId()

Expected result:

Both gadgets display xwiki/2.0.

Actual result:

The first gadget displays xwiki/2.0 while the second displays xwiki/2.1.

What happens in the background is that the execution of the first gadget's content clears the current macro block of the rendering context (as it doesn't use a fresh one) and $xwiki.getCurrentContentSyntaxId() then falls back to the current document's syntax.

I'm not sure this has any real consequences but it is an inconsistency that could have further consequences when the code further diverges or more code relies on the rendering context being pushed.

 
 

1 update

 
cid:jira-generated-image-avatar-e216d57d-4429-43de-9035-c00cf296c521 Changes by Michael Hamann on 31/Jul/26 12:17
 
Assignee: Michael Hamann