#110963Jump menu in a modal iframe (e.g. language selector of "Edit metadata") navigates the main content frame
Description
When a record edit form is opened inside a modal iframe, its language selector does not switch
the record inside the modal. Instead it loads the translated record into the main content frame
behind the modal and replaces whatever was being edited there.
The most common way to get there is the info modal of a file reference
(“Edit metadata of this file”).
Prerequisites
- TYPO3 13.4.35, PHP 8.3, MariaDB 10.11, Chrome and Chromium (current versions)
- A site with at least two languages
- A file whose sys_file_metadata record is translated into the second language
(Filelist > edit metadata > language selector > create translation)
Steps to reproduce
1. Create a content element “Text & Media” (or any record with a FAL field) and add that file.
2. Open the content element in the edit form (Page or List module).
3. In the file reference, click the info button (“i”).
4. In the info modal, click “Edit metadata of this file”.
The metadata edit form opens inside the modal (default language).
5. In the doc header of the modal, switch the language selector to the second language.
Actual result
- The modal keeps showing the default-language metadata record; only the select box shows
the second language.
- The main content frame behind the modal navigates to the translated metadata record. The
edit form of the content element is gone.
- After closing the modal and closing the translated metadata record, the user lands on
record/info?table=_FILE&uid=<file uid> as a full module (returnUrl of the modal form),<br> not on the content element.<br>So editing the caption in both languages from within a record is not possible this way.<br>Opening the same metadata record from the Filelist module and switching the language there<br>works, because there the form lives in the content frame itself.</file>
Expected result
The modal iframe navigates to the translated metadata record. The content frame behind the
modal stays unchanged. Closing the modal form returns to the info modal.
Cause
The language selector is rendered by Partials/Menus/SelectBoxJumpMenu.html with
data-global-event=“change” data-action-navigate=”$value”.
GlobalEventHandler::handleFormChildNavigateAction() then always calls
Viewport.ContentContainer.setUrl(locationHref);
and Viewport resolves to top.TYPO3.Backend, i.e. the main content frame, regardless of the
window the select box lives in. The code is identical in main
(Build/Sources/TypeScript/backend/global-event-handler.ts).
Possible fix
In handleFormChildNavigateAction(), navigate the own window when it is not the content module
frame, e.g. when window.frameElement exists and does not match
ScaffoldIdentifierEnum.contentModuleIframe: use window.location.assign(locationHref) instead of
ContentContainer.setUrl(). In an edit form, unsaved changes should still be guarded via
FormEngine.preventExitIfNotSaved().
We use this as a local workaround (capture-phase change listener for
select.t3-js-jumpMenuBox inside a modal iframe, loaded via AfterFormEnginePageInitializedEvent);
it works as expected, including the “close without saving” dialog.
Related observation (not part of this bug)
The info button of a file reference opens table=_FILE, so “Edit metadata of this file” always
opens the default-language metadata record, even from a translated record.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 2
History 1
-
Oliver Bartsch commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-11-16T16:31:07+00:00" > 11/16/26, 16:31 </span>
Hey,
thanks for the detailed report and the analysis, it’s correct for 13.4. The jump menu select in
SelectBoxJumpMenu.htmlis handled byGlobalEventHandler, which always callsViewport.ContentContainer.setUrl(). That always targets the content frame of the top window, even when the select is inside a modal iframe. The earlier fix for #102270 only covered the “Open in new window” popup, where no content frame exists at all.In main the code path is gone: the DocHeader rework (“[FEATURE] Improved DocHeader layout”) removed
SelectBoxJumpMenu.html, and the record language selector in the edit form is now a dropdown with plain links. Those links load the iframe they live in, so switching the language inside the modal stays inside the modal.13.4 only gets important and security fixes by now, so a backport of a change like this isn’t possible anymore. Your capture-phase listener is a good way to work around it until you upgrade to v14. Because of that, I’d close this issue as resolved in main. If you can still reproduce it on v14, please let us know and we’ll reopen it.
Thanks, Oli