#95263Selecting files in ElementBrowser does not work when editing records via info modal in filelist module
Description
Currently it is not possible to select a file as field value when editing a record via info modal. The value will be sent to the list_frame instead of the modal_frame where the record editing happens.
Steps to reproduce:
- Navigate to the filelist module
- Open info modal of file that has a list of references
- Edit reference via info modal
- Edit file field which opens the BrowseFiles/ElementBrowser modal
- Select another file
*Expected*
BrowsFiles/ElementBrowser modal will be closed and selected file is used as value of the file field.
*What actually happens*
BrowsFiles/ElementBrowser modal will be closed, selected file is not used as value of the file field.
Possible solution
The selection of the opener (message target) within the getParent() method of the typo3/sysext/recordlist/Resources/Public/JavaScript/ElementBrowser.js module should check if the BrowseFiles/ElementBrowser was opened by editing a record in another modal.
const parentFrames = window.parent ? Array.from(window.parent.frames) : [];
const modalFrames = parentFrames.filter(frame => frame.name === 'modal_frame');
const editDocumentFrame = modalFrames.filter(frame => null !== frame.document.querySelector('#EditDocumentController')).pop();
getParent() {
if (this.opener === null) {
if (editDocumentFrame) {
this.opener = editDocumentFrame;
}
...
}
...
}Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.