Issue Bug Under Review

#110126Workspace publish corrupts TCA group fields when page is enabled via context menu

Marya Hachimi 06/30/26, 18:07 updated 11/14/26, 16:08

Description

TYPO3 Version: 13.4.31

When a hidden page with populated TCA type=group fields is enabled via the page tree context menu while in a workspace, and then published, the group field values are replaced by the uid of the (now deleted) workspace version record.

*Steps to reproduce*
1. In LIVE workspace: create a new page, set it to hidden
2. fill in a type=group field with the uid of the new page
3. Save the page
4. Switch to a custom workspace
5. Right-click the page in the page tree → “Enable“
6. Open the Workspaces module → Publish the change
7. open page properties
8. The group field is empty (or contains an invalid uid that no longer exists in the database).

*Expected result*
The group field retains its original value.

*Root cause analysis*
When the context menu “Enable” action is triggered in a workspace, the DataHandler receives data[pages][uid][hidden]=0. Since there is no workspace version yet, DataHandler::process_datamap() calls versionizeRecord() → copyRecord_raw() to create a workspace copy.

During copyRecord_raw(), the field value passes through copyRecord_processManyToMany() → RelationHandler::start() / readList(). Later, when getVersionizedIncomingFieldArray() processes the field, it checks autoVersionIdMap and remaps referenced uids from live to workspace version uids.

Example: page uid=100 has pid_navigation=100 (self-reference). A workspace version uid=200 is created. The remapping changes pid_navigation from 100 to 200 in the workspace record.

During version_swap(), the workspace record (with pid_navigation=200) replaces the live record. compareFieldArrayWithCurrentAndUnset() sees that 200 ≠ 100, keeps the field, and writes 200 into live. The workspace record (uid=200) is then deleted. Result: pid_navigation=200 points to a non-existent record.

*Why it only happens via context menu*
When editing via FormEngine (page properties), ALL form fields are submitted. The DataHandler processes each field through checkValue() → checkValueForGroupFolderSelect() which properly resolves relations. The context menu only submits hidden=0, so the group fields are never re-validated — they carry the corrupted remapped value from the copy.

*Suggested fix location*
DataHandler::getVersionizedIncomingFieldArray() should not remap uids in type=group fields that reference their own table when the referenced record is not an inline child. Alternatively, DataHandlerHook::version_swap() should detect and reverse the remapping for non-inline group fields before writing.

Reviews 1

History 02