#78766getCopyHeader in Datahandler can be invoked up til 100 times if $GLOBALS['TCA'][$table]['ctrl']['prependAtCopy'] is not configured correctly
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);
}
Reviews 2
History 57
-
Susanne Moog changed category <span data-processor="relativetime" data-value="2018-01-24T20:01:22+00:00" > 01/24/18, 20:01 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 88791 status
NewUnder Review <span data-processor="relativetime" data-value="2025-03-27T10:39:47+00:00" > 03/27/25, 10:39 </span> -
Christian Kuhn changed removed the assignee <span data-processor="relativetime" data-value="2025-04-08T11:18:56+00:00" > 04/08/25, 11:18 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88980 <span data-processor="relativetime" data-value="2025-04-08T11:41:26+00:00" > 04/08/25, 11:41 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-04-08T12:00:08+00:00" > 04/08/25, 12:00 </span>Applied in changeset commit:7fa80c1a2ff740b00f45de7e591b0afec535e0de.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:36:43+00:00" > 12/02/25, 14:36 </span>
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);
> }