Bug #63728

Bug #63692: Memory consumption while bulk inserting

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

Added by Stephan Großberndt 8 months ago. Updated 5 months ago.

Status:Resolved Start date:2014-12-10
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:Performance Spent time: -
Target version:next-patchlevel
TYPO3 Version:6.2 Is Regression:No
PHP Version: Sprint Focus:
Complexity:

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.

Associated revisions

Revision f6c06bc3
Added by Stephan Großberndt 5 months ago

[BUGFIX] Avoid getTCAtypeValue-calls in DataHandler->fillInFieldArray

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/35227
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>
Reviewed-by: Benjamin Mack <>
Tested-by: Benjamin Mack <>

Revision 9f462369
Added by Stephan Großberndt 5 months ago

[BUGFIX] Avoid getTCAtypeValue-calls in DataHandler->fillInFieldArray

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 <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

History

#1 Updated by Gerrit Code Review 8 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35227

#2 Updated by Wouter Wolters 8 months ago

  • Parent task set to #63692

#3 Updated by Mathias Schreiber 8 months ago

  • Parent task deleted (#63692)

#4 Updated by Mathias Schreiber 8 months ago

  • Parent task set to #63692

#5 Updated by Gerrit Code Review 8 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35227

#6 Updated by Stephan Großberndt 5 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Gerrit Code Review 5 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37575

#8 Updated by Stephan Großberndt 5 months ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF