[BUGFIX] DataHandler: Use the updated field to determine record type 25/47125/2
authorHannes Lau <office@hanneslau.de>
Fri, 22 Jan 2016 17:51:20 +0000 (18:51 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sun, 6 Mar 2016 00:42:33 +0000 (01:42 +0100)
Use the new, updated field values of the current record, to determine
its type value. This allows to pick the correct RTE configuration
for new records with non-default types.

Fixes: #72898
Releases: master, 7.6
Change-Id: If519a9c9357034977ede40d7b709a7d83a3e92c8
Reviewed-on: https://review.typo3.org/46162
Reviewed-by: Sascha Egerer <sascha@sascha-egerer.de>
Reviewed-by: Eugen Lang <laeu1011+gerrit@gmail.com>
Tested-by: Eugen Lang <laeu1011+gerrit@gmail.com>
Tested-by: Jonas Götze <jonnsn@gmail.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
(cherry picked from commit 1dab32babef3a841d4281bed6874cc810a3c36bf)
Reviewed-on: https://review.typo3.org/47125

typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 5654700..69e7e39 100644 (file)
@@ -1556,7 +1556,7 @@ class DataHandler
             $fieldArray[$GLOBALS['TCA'][$table]['ctrl']['transOrigDiffSourceField']] = serialize($originalLanguage_diffStorage);
         }
         // Checking for RTE-transformations of fields:
-        $types_fieldConfig = BackendUtility::getTCAtypes($table, $currentRecord);
+        $types_fieldConfig = BackendUtility::getTCAtypes($table, $this->checkValue_currentRecord);
         $theTypeString = null;
         if (is_array($types_fieldConfig)) {
             foreach ($types_fieldConfig as $vconf) {
@@ -1568,12 +1568,12 @@ class DataHandler
                 // Look for transformation flag:
                 if ((string)$incomingFieldArray['_TRANSFORM_' . $vconf['field']] === 'RTE') {
                     if ($theTypeString === null) {
-                        $theTypeString = BackendUtility::getTCAtypeValue($table, $currentRecord);
+                        $theTypeString = BackendUtility::getTCAtypeValue($table, $this->checkValue_currentRecord);
                     }
                     $RTEsetup = $this->BE_USER->getTSConfig('RTE', BackendUtility::getPagesTSconfig($tscPID));
                     $thisConfig = BackendUtility::RTEsetup($RTEsetup['properties'], $table, $vconf['field'], $theTypeString);
                     $fieldArray[$vconf['field']] = $this->transformRichtextContentToDatabase(
-                        $fieldArray[$vconf['field']], $table, $vconf['field'], $vconf['spec'], $thisConfig, $currentRecord['pid']
+                        $fieldArray[$vconf['field']], $table, $vconf['field'], $vconf['spec'], $thisConfig, $this->checkValue_currentRecord['pid']
                     );
                 }
             }