Bug #88019

Page copying is not working as desired using clipboard

Added by Anu Bhuvanendran Nair 5 months ago. Updated 4 months ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Pagetree
Start date:
2019-03-27
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
page,copying
Complexity:
easy
Is Regression:
No
Sprint Focus:

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
                );
            }
        }

#1486233164 RuntimeException.png View (109 KB) Anu Bhuvanendran Nair, 2019-03-27 13:02

History

#1 Updated by Benni Mack 4 months ago

  • Target version changed from next-patchlevel to Candidate for patchlevel

Also available in: Atom PDF