Issue Bug Closed

#88019Page copying is not working as desired using clipboard

Anu Bhuvanendran Nair 03/27/19, 13:31 updated 01/20/26, 12:49

Description

When in page module, while trying to copy a page and trying to ‘Paste after’ any random page an error is struck. Both of the pages have more than 2 alternative languages. The environment contains pages which are migrated with upgrade wizard tasks regarding pages_language_overlay changes.
The error is as follows #1486233164 RuntimeException, Child record was not processed
As an outcome, a page will be copied with incomplete data and translations.

Please see the screenshot attached.

The issue is within typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php, where a synchronizeFieldValues() function receives an empty array as a parameter along with other values. In line no. 319


        //$forRecord is declared as an array. So it will always be.
        $forRecord = [];
        if (!$item->isNew()) {
            $forRecord = BackendUtility::getRecordWSOL(
                $item->getTableName(),
                $item->getId(),
                $fieldNameList
            );
        }

        //Even if $forRecord is not populated, control will bypass following condition as it is an is_array() check
        if (is_array($fromRecord) && is_array($forRecord)) {
            foreach ($fieldNames as $fieldName) {
                $this->synchronizeFieldValues(
                    $item,
                    $fieldName,
                    $fromRecord,
                    $forRecord
                );
            }
        }
    }

This can be solved by adjusting the condition as,

        if (is_array($fromRecord) && !empty($forRecord)) {
            foreach ($fieldNames as $fieldName) {
                $this->synchronizeFieldValues(
                    $item,
                    $fieldName,
                    $fromRecord,
                    $forRecord
                );
            }
        }

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.