[BUGFIX] Respect saveDocNew TSConfig option 03/58603/2
authorSusanne Moog <s.moog@neusta.de>
Tue, 9 Oct 2018 14:21:07 +0000 (16:21 +0200)
committerBenni Mack <benni@typo3.org>
Sun, 28 Oct 2018 11:26:52 +0000 (12:26 +0100)
For translated tt_content elements the saveDocNew button
was solely dependent on the free vs. connected mode setup.
However, if the button has been hidden via TSConfig
completely it should not magically reappear when editing a
translation in free mode.

(This patch only applies to TYPO3 8 as the buttons
changed for version 9).

Change-Id: I0f74e87acbac127b8bbc09f4fee39c633a3a49f6
Resolves: #85774
Releases: 8.7
Reviewed-on: https://review.typo3.org/58603
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Joerg Kummer <typo3@enobe.de>
Tested-by: Joerg Kummer <typo3@enobe.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Controller/EditDocumentController.php

index aa54917..21150d0 100644 (file)
@@ -1228,7 +1228,8 @@ class EditDocumentController extends AbstractModule
                 && $this->getNewIconMode($this->firstEl['table'])
             );
             // Hide the button for tt_content when in connected translation mode
-            if ($this->firstEl['table'] === 'tt_content') {
+            // if the button is enabled in general and the record is a translation
+            if ($showSaveAndNewButton && $sysLanguageUid > 0 && $this->firstEl['table'] === 'tt_content') {
                 $showSaveAndNewButton = $this->isPageInFreeTranslationMode(
                     (int)$this->pageinfo['uid'],
                     !$isSavedRecord ? (int)$this->defVals['colPos'] : (int)$record['colPos'],