This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-0e28ecef-52bf-45fc-b4d3-002b7b00bc0b XWIKI-25178 Open

Templates allowing asynchronous rendering are never displayed because of a malformed placeholder

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-8d0027fe-9c89-45eb-81a6-eacc66eb2971 Michael Hamann created this issue on 05/Oct/26 17:35
 
Summary: Templates allowing asynchronous rendering are never displayed because of a malformed placeholder
Issue Type: cid:jira-generated-image-avatar-0e28ecef-52bf-45fc-b4d3-002b7b00bc0b Bug
Affects Versions: 11.8-rc-1
Assignee: Unassigned
Components: Rendering - Async
Created: 05/Oct/26 17:35
Priority: cid:jira-generated-image-static-major-a9c4ccd1-39ef-4587-9ffa-50b72eec1325 Major
Reporter: Michael Hamann
Description:

A template that allows asynchronous rendering (with the ##!asyncAllowed=true header) is never displayed when it is rendered asynchronously: the HTML placeholder that should be replaced by the template content once it is ready is malformed, so the content is never loaded.

Steps to reproduce

  1. Create the file templates/asynctest.vm in the XWiki web application (e.g. webapps/xwiki/templates/asynctest.vm in the Jetty/HSQLDB distribution) with the following content:
    ##!asyncAllowed=true
    <p id="asyncTestContent">Asynchronous template content</p>
    
  2. Open /xwiki/bin/view/Main/?xpage=asynctest in the browser.

Expected result

The text "Asynchronous template content" is displayed, either directly or after it has been loaded asynchronously.

Actual result

The text is never displayed. The response contains a broken placeholder where the attributes are not separated, not quoted and the tag is self-closing:

<div class=xwiki-asyncdata-xwiki-async-id=template/environment%253A%252Ftemplates%252Fasynctest.vm/html%252F5.0/false/author/xwiki%253AXWiki.superadmin/secureDocument/null/RYULT8tS1data-xwiki-async-client-id=RYULT8tS1/>

Since the element doesn't have the xwiki-async class, the content is never fetched. Opening /xwiki/bin/view/Main/?xpage=asynctest&async=false displays the content as expected.