Details
-
Bug
-
Resolution: Unresolved
-
Blocker
-
18.2.0
-
Unknown
-
Description
Steps to reproduce
- Create a page whose content is a single Live Data macro call, for example:
{{liveData source="liveTable" sourceParameters="className=XWiki.XWikiUsers"/}} - View the page: the table is rendered, as expected.
- Click Edit to enter the in-place WYSIWYG editor: the table is still rendered inside the editor.
- Click the Source button, then click it again to go back to WYSIWYG.
Expected result
The Live Data is rendered in the editor again, as it was before switching to Source.
Actual result
The macro is not rendered anymore. Its output in the editor stays the bare, empty element the server sends back, <div class="liveData loading" data-config="..."/> with no children, so nothing meaningful is displayed where the table was. The macro call itself is not
lost: it is still in the widget's data-macro attribute and the page saves correctly.
Two things make this worse than a cosmetic glitch:
- The author has no way to tell the macro is still there. CKEditor reveals the macro-placeholder ("macro:liveData") only when the widget has neither width nor height
- The only thing that initializes a Live Data is the xwiki:dom:updated event (xwiki-platform-livedata-webjar .../src/main.js:
$(document).on("xwiki:dom:updated", init), which calls container.find(".liveData").liveData()). The macro widget does fire that event from its init (xwiki-macro/plugin.js, guarded by data-xwiki-dom-updated, added inCKEDITOR-328), and the element coming back from the Source round trip is freshly rendered by the server and therefore does not carry that flag - so on paper the event should fire again. Why the initialization nevertheless does not take effect on this path has not been identified yet, so the cause above is a lead, not a diagnosis.
Notes
- The standalone WYSIWYG editor (?editor=wysiwyg) is a different and already-known problem: there the Live Data never renders at all, before or after a Source round trip, only a loading spinner is shown. That one is explained by XWIKI-22781 (JavaScript skin extensions are not loaded in the standalone editor). The bug reported here is about the in-place editor, where the Live Data does render on entering edit mode and stops rendering only after the Source round trip.
- Verified on 18.8.0-SNAPSHOT (master). The code paths involved date back to 2020 (
CKEDITOR-328), so older versions are very likely affected too, but this has not been verified on the LTS - hence the Affects Version below is the most recent LTS rather than a verified oldest version.
Related issues
- XWIKI-22046 - blank-output macros get no placeholder or existence indicator in the editor (why the macro is not even selectable here).
- XWIKI-22781 - JavaScript skin extensions are not loaded in the standalone WYSIWYG editor (the separate standalone symptom).
- XWIKI-24096 - some macros don't execute properly when editing the source of a page in the in-place editor and saving from there (same editor, adjacent path).