Changes by Marius Dumitru Florea on 12/Nov/26 18:18
Documentation:
N/A
Resolution:
Fixed
Tests:
Unit
Status:
OpenClosed
1 comment
Marius Dumitru Florea on 12/Nov/26 18:17
Fixed as proposed in the description:
async.js parses the asynchronous result with $.parseHTML(xhr.responseText, document, false), replaces the placeholder with the parsed nodes and sends the xwiki:dom:updated event with these nodes (only the elements, not the text nodes), so the listeners initialize the content that is actually displayed.
Behaviour change, to mention in the release notes: the inline scripts of an asynchronous result are not executed anymore. The JavaScript files declared through the X-XWIKI-HTML-SCRIPTS HTTP response header are still loaded by xwiki.js.
Instead of a functional test, I added JavaScript unit tests (xwiki-platform-web-war/src/test/node/resources/uicomponents/async/_tests_/async.test.ts, run with Vitest as part of the web-war build), which check that the placeholder is replaced by the result, that the event targets the inserted elements and that the inline scripts of the result are not executed. The last two fail without the fix.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.