Bug #78766

getCopyHeader in Datahandler can be invoked up til 100 times if $GLOBALS['TCA'][$table]['ctrl']['prependAtCopy'] is not configured correctly

Added by Thomas Hohn over 2 years ago. Updated over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2016-11-22
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The method getCopyHeader can be invoked up to 100 times extra when copying elements if $GLOBALS['TCA'][$table]['ctrl']['prependAtCopy'] is empty.
The solution is to fetch the label in the beginning of the method
$label = $this->prependLabel($table)

and change

if ($rowCount) {
return $this->getCopyHeader($table, $pid, $field, $value, $count + 1, $checkTitle);
}

to

if (($rowCount) && (!empty($this->prependLabel($table)))){
return $this->getCopyHeader($table, $pid, $field, $value, $count + 1, $checkTitle);
}

History

#1 Updated by Thomas Hohn over 2 years ago

Thomas Hohn wrote:

The method getCopyHeader can be invoked up to 100 times extra when copying elements if $GLOBALS['TCA'][$table]['ctrl']['prependAtCopy'] is empty.
The solution is to fetch the label in the beginning of the method
$label = $this->prependLabel($table)

and change

if ($rowCount) {
return $this->getCopyHeader($table, $pid, $field, $value, $count + 1, $checkTitle);
}

to

if (($rowCount) && (!empty(label))) {
return $this->getCopyHeader($table, $pid, $field, $value, $count + 1, $checkTitle);
}

#2 Updated by Susanne Moog over 1 year ago

  • Category set to DataHandler aka TCEmain

Also available in: Atom PDF