Commit ddc5d1f8 authored by Chris Müller's avatar Chris Müller Committed by Christian Kuhn
Browse files

[BUGFIX] Avoid undefined array key error when copying record

This happens when "transOrigPointerField" is not defined in TCA configuration.

Additionally, a PHP 8.1 deprecation is fixed when passing a null to trim().

Resolves: #96514
Releases: main, 11.5
Change-Id: Ic99bd0b0c166397bda23d2e45ca2d4cb766000be

Tested-by: core-ci's avatarcore-ci <>
Tested-by: Christian Kuhn's avatarChristian Kuhn <>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <>
parent 77e2740e
......@@ -2524,7 +2524,7 @@ class DataHandler implements LoggerAwareInterface
foreach ($evalArray as $func) {
switch ($func) {
case 'trim':
$value = trim($value);
$value = trim((string)$value);
case 'required':
if (!$value) {
......@@ -3345,7 +3345,9 @@ class DataHandler implements LoggerAwareInterface
if (!$ignoreLocalization && $language == 0) {
//repointing the new translation records to the parent record we just created
$overrideValues[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] = $theNewSQLID;
if (isset($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'])) {
$overrideValues[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] = $theNewSQLID;
if (isset($GLOBALS['TCA'][$table]['ctrl']['translationSource'])) {
$overrideValues[$GLOBALS['TCA'][$table]['ctrl']['translationSource']] = 0;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment