Repository navigation
Cut/paste of a container leaves children on the source page when a later column has the lowest sorting - #784
Open
mtness wants to merge 1 commit into
Conversation
The children of a moved or copied container are handled column by column, and the target of a column is the last child of the previous column (see ContainerService::getNewContentElementAtTopTargetInColumn()). The column order was taken from the children records, which are fetched ORDER BY sorting: if the child with the lowest sorting is not in the first column, the target of another column is a child that has not been moved yet. That target resolves to the pid of the source page, so the child stays behind on it. Use the configured column order of the container CType instead, the same order the target is resolved with. Children with a colPos that is not configured for the container are still moved, after the others. Fixes: b13#291 Related: b13#738
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TYPO3 14.3.10, container 4.1.1, also on master 3a44aaf.
Steps
Actual: the container and the colPos 101 child move to B. The colPos 102 and 103 children stay on A; sys_log shows "Moved record … on page A" for them.
Cause: children are fetched ORDER BY sorting, so getChildrenColPos() returns 103, 102, 101. copyOrMoveChildren() walks the columns in that order and rewrites each child's target to -uid of the last child of the previous column — a child still on page A. This is the residual case of #291, whose fix iterates getChildrenColPos(), and the same target anchoring as in #738.
Fix: process the columns in getAllAvailableColumnsColPos() order. Functional test moveContainerOtherPageOnTopWithChildSortingBeforePreviousColumn reproduces it (red before, green after). PR: .
Fixes: #291
Related: #738