Issue Bug Under Review

#111526Contextual edit sheet cancels the navigation that closes it after a save

Josua Vogel 11/21/26, 18:40 updated 11/21/26, 18:44

Description

Problem

A navigation of the content frame that starts in the contextual record edit sheet after the record was saved there sometimes ends in the page module instead of the target. The sheet closes, the content frame stays on (or returns to) the page module.

Steps to reproduce

  1. Open the page module and edit a content element in the contextual edit sheet.
  2. Change a field and save in the sheet.
  3. Click the button to open the full edit view in the sheet header.
  4. The sheet closes; intermittently the page module is shown instead of the full edit view.

Cause

Build/Sources/TypeScript/backend/element/contextual-record-edit-trigger.ts, setupMessageHandling(): on typo3:editform:navigate the sheet closes, and its typo3-modal-hidden handler calls ContentContainer.refresh() when the record was saved in the sheet. refresh() reloads the document the content frame still shows (location.reload()), which cancels the navigation that closed the sheet.

Suggested fix

--- a/Build/Sources/TypeScript/backend/element/contextual-record-edit-trigger.ts
+++ b/Build/Sources/TypeScript/backend/element/contextual-record-edit-trigger.ts
     if (event.data?.actionName === 'typo3:editform:navigate') {
       closeConfirmed = true;
+      navigated = true;
       modal.hideModal();
 ...
-      if (topWindow.TYPO3?.Backend?.ContentContainer) {
+      // A navigation loads the content frame anew, and a reload would cancel it
+      if (!navigated && topWindow.TYPO3?.Backend?.ContentContainer) {
         topWindow.TYPO3.Backend.ContentContainer.refresh();
       }

Reviews 1

History 01