Project

General

Profile

Actions

Bug #82784

open

DataHandler: copyRecords doesn't set sorting correctly for negative $destPid

Added by Sebastian Michaelsen over 6 years ago. Updated 11 months ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2017-10-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Stabilization Sprint

Description

In DataHandler->copyRecord() accepts a $destPid which (according to the phpDoc) can either contain a page id or (indicated by a negative number) a content uid after which the source record is copied to. This "convention" is also used in DataHandler->moveRecord().

However DataHandler->copyRecord() does not implement the functionality. Only DataHandler->moveRecord() does.

How to reproduce:

            $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
            $data = [
                'tt_content' => [
                    $sourceContentUid=> [
                        'copy' => ($targetContentUid * -1),
                    ],
                ],
            ];
            $dataHandler->start([], $data);
            $dataHandler->process_cmdmap();

The copied element will just receive the sorting value of the source element instead of being sorted after the target content element.

Actions

Also available in: Atom PDF