[BUGFIX] Do not fetch TSconfig in process_datamap for non-page-records 18/35318/2
authorStephan Großberndt <stephan@grossberndt.de>
Thu, 11 Dec 2014 14:32:07 +0000 (15:32 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 11 Dec 2014 21:01:30 +0000 (22:01 +0100)
In DataHandler->process_datamap for each record getTCEMAIN_TSconfig()
is executed, but the returned TSconfig is used only if table is "pages"
and status is "new".

Fetches the TSconfig only if table is "pages" and status is "new".

Resolves: #63778
Releases: master, 6.2
Change-Id: Ifded6daf2b5b6b61a9c95ba3962566450a07d72e
Reviewed-on: http://review.typo3.org/35318
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 87dcf91..6eff43a 100644 (file)
@@ -1131,9 +1131,11 @@ class DataHandler {
                                                if ($recordAccess) {
                                                        // Here the "pid" is set IF NOT the old pid was a string pointing to a place in the subst-id array.
                                                        list($tscPID) = BackendUtility::getTSCpid($table, $id, $old_pid_value ? $old_pid_value : $fieldArray['pid']);
-                                                       $TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
-                                                       if ($status == 'new' && $table == 'pages' && is_array($TSConfig['permissions.'])) {
-                                                               $fieldArray = $this->setTSconfigPermissions($fieldArray, $TSConfig['permissions.']);
+                                                       if ($status === 'new' && $table === 'pages') {
+                                                               $TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
+                                                               if (isset($TSConfig['permissions.']) && is_array($TSConfig['permissions.'])) {
+                                                                       $fieldArray = $this->setTSconfigPermissions($fieldArray, $TSConfig['permissions.']);
+                                                               }
                                                        }
                                                        // Processing of all fields in incomingFieldArray and setting them in $fieldArray
                                                        $fieldArray = $this->fillInFieldArray($table, $id, $fieldArray, $incomingFieldArray, $theRealPid, $status, $tscPID);