Project

General

Profile

Actions

Bug #88019

open

Epic #90676: Clipboard related bugs and features

Page copying is not working as desired using clipboard

Added by Anu Bhuvanendran Nair over 5 years ago. Updated 5 months ago.

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

0%

Estimated time:
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
                );
            }
        }

Files

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

Also available in: Atom PDF