Issue Bug Closed

#63728Unnecessary calls to BackendUtility->getTCAtypeValue in DataHandler->fillInFieldArray

Stephan Großberndt 12/10/14, 10:51 updated 10/02/18, 11:48

Description

DataHandler->fillInFieldArray fetches $theTypeString = BackendUtility::getTCAtypeValue for each record but uses this value only if
  • is_array($types_fieldConfig)
  • !$this->dontProcessTransformations
  • isset($fieldArray[$vconf[‘field’]])
  • (string) $incomingFieldArray[(‘TRANSFORM’ . $vconf[‘field’])] == ‘RTE’
// Checking for RTE-transformations of fields:
$types_fieldConfig = BackendUtility::getTCAtypes($table, $currentRecord);
$theTypeString = BackendUtility::getTCAtypeValue($table, $currentRecord);
if (is_array($types_fieldConfig)) {
    foreach ($types_fieldConfig as $vconf) {
        // Write file configuration:
        // inserted array_merge($currentRecord,$fieldArray) 170502
        $eFile = \TYPO3\CMS\Core\Html\RteHtmlParser::evalWriteFile($vconf['spec']['static_write'], array_merge($currentRecord, $fieldArray));
        // RTE transformations:
        if (!$this->dontProcessTransformations) {
            if (isset($fieldArray[$vconf['field']])) {
                // Look for transformation flag:
                switch ((string) $incomingFieldArray[('_TRANSFORM_' . $vconf['field'])]) {
                    case 'RTE':
                        $RTEsetup = $this->BE_USER->getTSConfig('RTE', BackendUtility::getPagesTSconfig($tscPID));
                        $thisConfig = BackendUtility::RTEsetup($RTEsetup['properties'], $table, $vconf['field'], $theTypeString);

Instead of calling this function unconditionally it should only be called if a first RTE with transformations is detected and be cached then.

Reviews 2