Issue Bug Closed

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

Thomas Hohn 11/22/16, 13:48 updated 12/02/25, 14:36

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

  1. Thomas Hohn commented <span data-processor="relativetime" data-value="2016-11-22T13:49:51+00:00" > 11/22/16, 13:49 </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);
    > }

  2. Benni Mack commented and changed status Under Review Resolved done 0 % 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.