[BUGFIX] Avoid getTCAtypeValue-calls in DataHandler->fillInFieldArray 75/37575/2
authorStephan Großberndt <stephan@grossberndt.de>
Wed, 10 Dec 2014 10:13:43 +0000 (11:13 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 5 Mar 2015 21:24:37 +0000 (22:24 +0100)
DataHandler->fillInFieldArray fetches BackendUtility::getTCAtypeValue
for each record but uses the value only if several RTE-transformation-
related conditions are met.

Fetch BackendUtility::getTCAtypeValue only if the RTE-transformation-
related conditions are met for the first time and keep it afterwards.

Resolves: #63728
Releases: master, 6.2
Change-Id: I14b307c45cab2d778968f3fd98c18348b666be3d
Reviewed-on: http://review.typo3.org/37575
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index b5c9a69..a62ef08 100644 (file)
@@ -1446,7 +1446,7 @@ class DataHandler {
                }
                // Checking for RTE-transformations of fields:
                $types_fieldConfig = BackendUtility::getTCAtypes($table, $currentRecord);
-               $theTypeString = BackendUtility::getTCAtypeValue($table, $currentRecord);
+               $theTypeString = NULL;
                if (is_array($types_fieldConfig)) {
                        foreach ($types_fieldConfig as $vconf) {
                                $eFile = NULL;
@@ -1466,6 +1466,9 @@ class DataHandler {
                                                // Look for transformation flag:
                                                switch ((string) $incomingFieldArray[('_TRANSFORM_' . $vconf['field'])]) {
                                                        case 'RTE':
+                                                               if ($theTypeString === NULL) {
+                                                                       $theTypeString = BackendUtility::getTCAtypeValue($table, $currentRecord);
+                                                               }
                                                                $RTEsetup = $this->BE_USER->getTSConfig('RTE', BackendUtility::getPagesTSconfig($tscPID));
                                                                $thisConfig = BackendUtility::RTEsetup($RTEsetup['properties'], $table, $vconf['field'], $theTypeString);
                                                                // Set alternative relative path for RTE images/links: