Skip to content

[BUGFIX] Preserve container sorting after copying and moving - #1

Open
thegass wants to merge 1 commit into
mainfrom
fix-sorting
Open

[BUGFIX] Preserve container sorting after copying and moving#1
thegass wants to merge 1 commit into
mainfrom
fix-sorting

Conversation

@thegass

@thegass thegass commented Sep 9, 2026

Copy link
Copy Markdown
Member

Copying a container can leave its children with sorting values starting at 1. A subsequent paste after that container then targets a child above the container, causing the new element to jump toward the top of the page.

Reuse b13/container's sorting implementation and run it after inline copy relations have been remapped, after moves, and after relevant saves. Include newly created containers, clear the pending sorting queue before processing, and handle nested moves so descendants remain with their container. Reorder affected children even when their values exceed the parent's value, since unrelated records can still sit between them. The redundant b13 copy hook remains disabled.

Validation: 33 regression checkpoints passed using this repository's source in a TYPO3 13.4.35 / b13/container 4.1.0 application. Covered five consecutive copies, moves up and down, reversed child order on save, repeat saves, new inline containers, nested and multi-column containers, and connected localization across three runs (languages 0, 1 and 2). Checks used temporary database tables; the application-specific regression harness is not included in this repository. git diff --check passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant