From 521ecb29da4255a9302bd0a0f0e06b14fa0974ad Mon Sep 17 00:00:00 2001 From: Wolfgang Klinger Date: Wed, 13 Mar 2019 16:23:31 +0100 Subject: [PATCH] [BUGFIX] Prevent empty new form from being closed without confirmation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set ‘has-change’ on new empty content element form container to trigger the confirmation dialog when using ‘Close’. Resolves: #87890 Releases: master, 9.5 Change-Id: Idc3d8fdca0f865991ee09935f4b75683dffb4d7e Reviewed-on: https://review.typo3.org/c/60237 Tested-by: TYPO3com Tested-by: Georg Ringer Tested-by: Josef Glatz Tested-by: Riccardo De Contardi Tested-by: Daniel Goerz Reviewed-by: Georg Ringer Reviewed-by: Josef Glatz Reviewed-by: Daniel Goerz --- .../backend/Classes/Form/Container/OuterWrapContainer.php | 3 ++- .../Resources/Private/Templates/OuterWrapContainer.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php b/typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php index f6195a7cd3c7..a9e7239d804c 100644 --- a/typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php +++ b/typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php @@ -144,7 +144,8 @@ public function render() 'childHtml' => $childHtml, 'icon' => $icon, 'tableTitle' => $tableTitle, - 'newOrUid' => $newOrUid + 'newOrUid' => $newOrUid, + 'isNewRecord' => $this->data['command'] === 'new' ]); $result['html'] = $view->render(); return $result; diff --git a/typo3/sysext/backend/Resources/Private/Templates/OuterWrapContainer.html b/typo3/sysext/backend/Resources/Private/Templates/OuterWrapContainer.html index 738b4098d64c..35b4406ea36c 100644 --- a/typo3/sysext/backend/Resources/Private/Templates/OuterWrapContainer.html +++ b/typo3/sysext/backend/Resources/Private/Templates/OuterWrapContainer.html @@ -11,7 +11,7 @@

{pageTitle}

-
+
{fieldInformationHtml} {fieldWizardHtml} {childHtml}