[BUGFIX] Redirect to the list after save&close in text file edit form 57/54757/4
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Fri, 24 Nov 2017 23:00:24 +0000 (00:00 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 27 Nov 2017 21:23:49 +0000 (22:23 +0100)
Clicking on the Save & Close button in the FileList
text file editing form redirects back to the list view.

Releases: master
Resolves: #83090
Change-Id: I14576da7a77835232ca9573a8964f0d754f52aff
Reviewed-on: https://review.typo3.org/54757
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/backend/Classes/Controller/File/EditFileController.php

index 8429776..ef5d9c6 100644 (file)
@@ -302,20 +302,19 @@ class EditFileController
         $saveButton = $buttonBar->makeInputButton()
             ->setName('_save')
             ->setValue('1')
-            ->setOnClick('document.editform.submit();')
             ->setForm('EditFileController')
             ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_edit.php.submit'))
             ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save', Icon::SIZE_SMALL));
 
         // Save and Close button
         $saveAndCloseButton = $buttonBar->makeInputButton()
-            ->setName('_saveandclose')
+            ->setName('_saveandclosedok')
             ->setValue('1')
             ->setForm('EditFileController')
             ->setOnClick(
-                'document.editform.redirect.value='
+                'document.editform.elements.namedItem("data[editfile][0][redirect]").value='
                 . GeneralUtility::quoteJSvalue($this->returnUrl)
-                . '; document.editform.submit();'
+                . ';'
             )
             ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_edit.php.saveAndClose'))
             ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(