Commit 234569f4 authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Georg Ringer
Browse files

[BUGFIX] Late bind drag uploader

If TCA with a file upload is used within IRRE (e.g. as done by
EXT:news), creating a new record or opening an existing record now sets
up the drag uploader.

As the DragUploader module is loaded independently from the FormEngine
main module, loading order may vary, rendering an event-based solution
unstable. To solve this issue without any major refactorings, a
MutationObserver is installed by the DragUploader module.

Resolves: #97676
Releases: main, 11.5
Change-Id: I36a3922999842f4d0bddfc7e4b148ec39880d9df
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74748


Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 78d81a90
......@@ -853,6 +853,12 @@ class DragUploader {
$(() => {
$('.t3js-drag-uploader').dragUploader(opts);
});
// TODO: Refactor the FormEngine integration of the uploader to instance new uploaders via event handlers
const observer = new MutationObserver((): void => {
$('.t3js-drag-uploader').dragUploader(opts);
});
observer.observe(document, {childList: true, subtree: true});
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment