Details
-
Bug
-
Resolution: Fixed
-
Major
-
11.8-rc-1
-
None
-
Unit
-
Unknown
-
N/A
-
N/A
-
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
- 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>
- Open /xwiki/bin/view/Main/?viewer=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 page is displayed but the text never appears. The HTML of the page 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/?viewer=asynctest&async=false displays the content as expected.