[BUGFIX] DocumentEditController save with translation broken 30/52730/2
authorMarkus Sommer <markussom@posteo.de>
Fri, 5 May 2017 11:48:09 +0000 (13:48 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Sat, 3 Jun 2017 13:10:41 +0000 (15:10 +0200)
With changing the input type=image to input type=submit,
the x/y values are no longer transferred the
EditDocumentController checked for, and content is no
longer saved. Adapt the controller code for the new parameters.

Resolves: #76649
Releases: 8.7, master

Change-Id: I921b92f1086e142592fc84083656c4baecd43aa7
Reviewed-on: https://review.typo3.org/52730
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Resources/Public/JavaScript/SplitButtons.js

index 6a8e706..82fa866 100644 (file)
@@ -500,8 +500,8 @@ class EditDocumentController extends AbstractModule
             || isset($_POST['_saveandclosedok'])
             || isset($_POST['_savedokview'])
             || isset($_POST['_savedoknew'])
-            || isset($_POST['_translation_savedok_x'])
-            || isset($_POST['_translation_savedokclear_x']);
+            || isset($_POST['_translation_savedok'])
+            || isset($_POST['_translation_savedokclear']);
         return $out;
     }
 
@@ -527,10 +527,10 @@ class EditDocumentController extends AbstractModule
         if (!empty($control)) {
             $tce->setControl($control);
         }
-        if (isset($_POST['_translation_savedok_x'])) {
+        if (isset($_POST['_translation_savedok'])) {
             $tce->updateModeL10NdiffData = 'FORCE_FFUPD';
         }
-        if (isset($_POST['_translation_savedokclear_x'])) {
+        if (isset($_POST['_translation_savedokclear'])) {
             $tce->updateModeL10NdiffData = 'FORCE_FFUPD';
             $tce->updateModeL10NdiffDataClear = true;
         }
@@ -684,13 +684,13 @@ class EditDocumentController extends AbstractModule
                 $this->previewData['table'] = $table;
                 $this->previewData['id'] = $id;
             }
-            $tce->printLogErrorMessages(isset($_POST['_saveandclosedok']) || isset($_POST['_translation_savedok_x']) ? $this->retUrl : $this->R_URL_parts['path'] . '?' . GeneralUtility::implodeArrayForUrl('', $this->R_URL_getvars));
+            $tce->printLogErrorMessages(isset($_POST['_saveandclosedok']) || isset($_POST['_translation_savedok']) ? $this->retUrl : $this->R_URL_parts['path'] . '?' . GeneralUtility::implodeArrayForUrl('', $this->R_URL_getvars));
         }
         //  || count($tce->substNEWwithIDs)... If any new items has been save, the document is CLOSED
         // because if not, we just get that element re-listed as new. And we don't want that!
         if ((int)$this->closeDoc < self::DOCUMENT_CLOSE_MODE_DEFAULT
             || isset($_POST['_saveandclosedok'])
-            || isset($_POST['_translation_savedok_x'])
+            || isset($_POST['_translation_savedok'])
         ) {
             $this->closeDocument(abs($this->closeDoc));
         }
index 7c11585..71fda54 100644 (file)
@@ -37,7 +37,11 @@ define(['jquery', 'TYPO3/CMS/Backend/Icons'], function($, Icons) {
                        'button[name^="_save"]',
                        'a[data-name^="_save"]',
                        'button[name="CMD"][value^="save"]',
-                       'a[data-name="CMD"][data-value^="save"]'
+                       'a[data-name="CMD"][data-value^="save"]',
+                       'button[name^="_translation_save"]',
+                       'a[data-name^="_translation_save"]',
+                       'button[name="CMD"][value^="_translation_save"]',
+                       'a[data-name="CMD"][data-value^="_translation_save"]'
                ].join(',');
                $('.t3js-module-docheader').on('click', elements, function(e) {
                        // prevent doubleclick double submission bug in chrome,