Skip to content

[BUG] Copy container to another page (same language) breaks sorting — new elements land at top of column #726

@MacGyer

Description

@MacGyer

Environment

  • TYPO3: 13.4.x
  • b13/container: 3.2.3
  • PHP: 8.4

Steps to reproduce

  1. On page A, create a new container content element
  2. Add at least one child content element inside the container
  3. Copy the container via the page module clipboard (same language) to page B
  4. On page B, add a new content element after the copied container

Expected result

The new content element is placed after the container.

Actual result

The new content element appears at the top of the column instead of after the container. Additionally, the TYPO3 upgrade wizard "EXT:container: Migrate 'container' sorting" is no longer marked as complete and must be re-run to restore correct sorting behaviour.

Background / Regression

This bug was fixed in v3.1.8 (PR #612) and v3.1.9 (PR #615, fixes #614) for the same-language copy scenario. Commit 72b79ce (released in v3.1.10, included in v3.2.x) refactored CommandMapPostProcessingHook.php by splitting localizeOrCopyToLanguage() into separate localizeChildren() and copyToLanguageChildren() methods. This refactoring appears to have reintroduced the sorting issue for same-language clipboard copies.

The fix shipped in v3.2.3 (PR #709, fixes #703) addresses a related problem (children disappearing on drag-and-drop copy) by rewriting simple DataHandler commands in CommandMapBeforeStartHook.php, but does not cover the sorting regression described here.

Affected files:

  • Classes/Hooks/Datahandler/CommandMapPostProcessingHook.php
  • Classes/Hooks/Datahandler/CommandMapBeforeStartHook.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions