Issue Bug Closed

#110590Publishing a new workspace record rewrites unrelated history entries

Benni Mack 09/01/26, 19:29 updated 09/08/26, 10:03

Description

Workspaces\Hook\DataHandlerHook::publishNewRecord() calls RecordHistoryStore::publishRecord($table, $id, 0, ...) — the versioned uid is 0 because a record created in a workspace keeps its uid when published.

publishRecord() then calls migrateWorkspaceHistory() unconditionally, which executes:

UPDATE sys_history SET recuid = <liveUid> WHERE tablename = <table> AND recuid = 0

With $versionedId = 0 this matches every sys_history row of that table whose recuid is 0 and rebinds them to an unrelated record. The statement is additionally not restricted to the workspace being published.

Expected: skip the migration when $versionedId <= 0, and restrict the update to the workspace the record is published from.

Introduced with #102381.

Reviews 2

History 26

  1. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-02T18:30:10+00:00" > 09/02/26, 18:30 </span>

    Applied in changeset commit:15ce934da0111ef8d0e749ae1d3d80e92d0b3020.