Issue Bug Under Review

#110114Workspaces: moving a page into itself via its duplicate page-tree node creates a self-referential MOVE_POINTER (pid = t3ver_oid)

Philipp Kitzberger 06/26/26, 14:29 updated 11/14/26, 16:02

Description

In a workspace, a page that has been moved is shown twice in the page tree — once at its original (live) position and once at its moved position. Dragging one representation into the other issues a “move page into itself”. The backend fails to reject this and writes a workspace MOVE_POINTER whose pid equals its own t3ver_oid. The page becomes its own parent, producing a rootline cycle (broken/looping page tree in the workspace, and a corrupt live tree on publish).

Preconditions

  • A workspace exists and the editor works inside it.
  • A page (here: live uid 12345) with move/edit permissions, located under some parent.

Steps to reproduce

1. Switch to a workspace.
2. In the page tree, drag page 12345 to a different parent (a normal, valid move). The page now appears twice in the tree: at its original position and at the new position.
3. Drag the moved representation back and drop it inside the other representation of the same page.
4. Confirm the move in the dialog.

Expected

The move is rejected — as it already is in the Live workspace, and as normal drag & drop prevents dropping a node into itself or its own subtree.

Actual

A self-referential workspace version is written.

Effective command: cmd[pages][12345][move] = 12345.

Resulting row:

uid pid t3ver_oid t3ver_wsid t3ver_state deleted
12346 12345 12345 1 4 0

i.e. pid t3ver_oid 12345 (a MOVE_POINTER pointing the page under itself).

Impact

Rootline becomes cyclic. Symptoms: looping/broken page tree and recursion errors in the workspace; on publish the live page’s pid is set to itself, corrupting the live tree. See #110092 as well.

Root cause

Two independent gaps combine:

1. Page tree. A workspace-moved page is rendered as two distinct nodes sharing the same identifier (uid) but different __treeIdentifier (path) — PageTreeRepository resolves the MOVE_POINTER to the live uid with the moved pid (PageTreeRepository.php:336-344, :465-474), and node identity/keying is path-based (tree.ts:624-630, render repeat() key at tree.ts:746). The drag guard only blocks on object identity or the target’s positional parents:

// Build/Sources/TypeScript/backend/tree/tree.ts (handleNodeDragOver), ~938-955
if (this.draggingNode == targetNode) { … return true; }
if (targetNode.__parents.includes(this.draggingNode.identifier)) { … return true; }

Dragging one representation onto the other passes both checks (different objects; the original-position node does not list its own uid as a parent), so a MOVE is armed.

2. DataHandler. The only server-side cycle guard is destNotInsideSelf(), but in moveRecord() it is called with the workspace version uid as source, not the live uid:

// typo3/sysext/core/Classes/DataHandling/DataHandler.php
$sourceUid = (int)($workspaceRecord[‘uid’] ?? $liveRecord[‘uid’]); // ~4413
…
if (!$this->destNotInsideSelf($updateFields[‘pid’], $sourceUid)) { // ~4470 -> uses version uid
… // rejected
}

A freshly created version uid never appears in the live rootline, so destNotInsideSelf() (definition at :7572) walks up the destination rootline and never matches → the move is wrongly accepted. In the Live workspace $sourceUid is the live uid and the same check correctly rejects the move ($destinationId === $id).

Suggested fix

  • Primary (server-side, covers every entry point): pass the live uid to the guard in moveRecord(). This also fixes the “move into a real descendant in a workspace” variant.
  • Secondary (page tree, optional hardening): in the page-tree drag guard, treat nodes with the same identifier as the same page (compare identifier, and include the dragged node’s own uid when testing the target’s rootline), and/or avoid rendering a moved page as two nodes.

Notes

The identical corrupt state is also reproducible via cut → “Paste into” the page itself in a workspace (the context menu’s canBePastedInto() and SimpleDataHandlerController::setPasteCmd() perform no self/subtree check and rely on the same broken server guard). A fix in destNotInsideSelf()/@moveRecord()@ closes all of these at once.

Reviews 1

History 01