[BUGFIX] Do not re-sort IRRE children when sorting parent 59/57259/6
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Mon, 25 Jun 2018 18:59:30 +0000 (20:59 +0200)
committerAndreas Wolf <andreas.wolf@typo3.org>
Wed, 18 Jul 2018 18:09:59 +0000 (20:09 +0200)
commit65537d75e3316a8a59bc82703b5502af4d30842f
tree87c31c47bb46f9fe40c7504c920e3085a1c48013
parente726a74fb03d09fed7f20c3064652ca7884060cd
[BUGFIX] Do not re-sort IRRE children when sorting parent

When PID of the parent record has not changed, child records should
not be moved/sorted.

Little background helping reviewing the patch:

The 2 important changes are made in DataHandler.php line 4603
and DataHandlerHook.php around line 346.
In both cases the condition is added checking if the destination PID
of the record is the same as current one.
In that case, processing of the IRRE children is skipped.

All the changes made in the .csv files are reflecting that.
To validate them one can compare the content of the csv files
with LiveDefaultElements.csv datasets.

For example, check that sorting values in file:
core/Tests/Functional/DataHandling/IRRE/CSV/Modify/DataSet/changeParentContentSorting.csv
are the same as in the:
core/Tests/Functional/DataHandling/IRRE/CSV/DataSet/LiveDefaultElements.csv

In the Workspaces related datasets, you will see that there
are no move placeholders for IRRE children any more
(and versioned records have 0 instead of 4 in the t3ver_state).

See e.g.:
workspaces/Tests/Functional/DataHandling/FAL/Modify/DataSet/changeContentSorting.csv
or
workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/DataSet/changeParentContentSorting.csv

This patch also solves the issue that sorting of the LIVE records (IRRE children)
were modified, when sorting parent record in the Workspaces,
see e.g. record tx_irretutorial_1nff_hotel uid 2 and 5 in file:
workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/changeParentContentSorting.csv

Releases: master, 8.7
Resolved: #85304
Change-Id: I44573b334873400af628066beae84705c5af0408
Reviewed-on: https://review.typo3.org/57259
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Jord de Jong <jord.dejong@windinternet.nl>
Reviewed-by: Robert van Kammen <rvkammen@hotmail.com>
Tested-by: Robert van Kammen <rvkammen@hotmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Rudy Gnodde <rgn@windinternet.nl>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/Modify/DataSet/changeParentContentSorting.csv
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/changeParentContentSorting.csv
typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Modify/DataSet/changeContentSorting.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/DataSet/changeParentContentSorting.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Publish/DataSet/changeParentContentSorting.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/PublishAll/DataSet/changeParentContentSorting.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/changeParentContentSorting.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Publish/DataSet/changeParentContentSorting.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/PublishAll/DataSet/changeParentContentSorting.csv