Actions
Bug #95263
openSelecting files in ElementBrowser does not work when editing records via info modal in filelist module
Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2021-09-17
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
ElementBrowser Recordlist
Complexity:
Is Regression:
Sprint Focus:
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;
}
...
}
...
}
No data to display
Actions