[TASK] Streamline usage of BackendUtility::getPagesTSconfig() 49/25249/6
authorPhilipp Gampe <philipp.gampe@typo3.org>
Sat, 9 Nov 2013 22:35:51 +0000 (23:35 +0100)
committerBenjamin Mack <benni@typo3.org>
Mon, 20 Jan 2014 19:29:14 +0000 (20:29 +0100)
Avoid calling BackendUtility::getPagesTSconfig() with default or useless
parameters.

Resolves: #53502
Releases: 6.2
Change-Id: I842c33022a00f5633b1ef5a250d143b6a253dde1
Reviewed-on: https://review.typo3.org/25249
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
typo3/sysext/backend/Classes/Form/Element/InlineElement.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/info_pagetsconfig/Classes/Controller/InfoPageTyposcriptConfigController.php

index edfa539..aa76cd2 100644 (file)
@@ -1610,7 +1610,7 @@ class InlineElement {
         */
        protected function getNewRecordPid($table, $parentPid = NULL) {
                $newRecordPid = $this->inlineFirstPid;
-               $pageTS = BackendUtility::getPagesTSconfig($parentPid, TRUE);
+               $pageTS = BackendUtility::getPagesTSconfig($parentPid);
                if (isset($pageTS['TCAdefaults.'][$table . '.']['pid']) && MathUtility::canBeInterpretedAsInteger($pageTS['TCAdefaults.'][$table . '.']['pid'])) {
                        $newRecordPid = $pageTS['TCAdefaults.'][$table . '.']['pid'];
                } elseif (isset($parentPid) && MathUtility::canBeInterpretedAsInteger($parentPid)) {
index 14f5172..79680ed 100644 (file)
@@ -3245,9 +3245,8 @@ class BackendUtility {
                $typeVal = self::getTCAtypeValue($table, $row);
                // Get main config for the table
                list($TScID, $cPid) = self::getTSCpid($table, $row['uid'], $row['pid']);
-               $rootLine = self::BEgetRootLine($TScID, '', TRUE);
                if ($TScID >= 0) {
-                       $tempConf = $GLOBALS['BE_USER']->getTSConfig('TCEFORM.' . $table, self::getPagesTSconfig($TScID, $rootLine));
+                       $tempConf = $GLOBALS['BE_USER']->getTSConfig('TCEFORM.' . $table, self::getPagesTSconfig($TScID));
                        if (is_array($tempConf['properties'])) {
                                foreach ($tempConf['properties'] as $key => $val) {
                                        if (is_array($val)) {
@@ -3266,6 +3265,7 @@ class BackendUtility {
                $res['_THIS_CID'] = $row['cid'];
                // So the row will be passed to foreign_table_where_query()
                $res['_THIS_ROW'] = $row;
+               $rootLine = self::BEgetRootLine($TScID, '', TRUE);
                foreach ($rootLine as $rC) {
                        if (!$res['_STORAGE_PID']) {
                                $res['_STORAGE_PID'] = intval($rC['storage_pid']);
index 7879dba..18a669a 100644 (file)
@@ -88,7 +88,7 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
                $theOutput = $this->pObj->doc->header($GLOBALS['LANG']->getLL('tsconf_title'));
 
                if ($this->pObj->MOD_SETTINGS['tsconf_parts'] == 99) {
-                       $TSparts = BackendUtility::getPagesTSconfig($this->pObj->id, '', TRUE);
+                       $TSparts = BackendUtility::getPagesTSconfig($this->pObj->id, NULL, TRUE);
                        $lines = array();
                        $pUids = array();
                        foreach ($TSparts as $k => $v) {