#110887Workspace preview fails with TypeError for a move pointer whose live record is deleted
Description
Problem
In a workspace, the frontend preview of a page fails with
TypeError TYPO3\CMS\Core\Domain\Repository\PageRepository::getWorkspaceVersionOfRecord(): Argument #2 ($liveRecord) must be of type array, false given
as soon as a record on that page is a move pointer (t3ver_state=4) whose live record (t3ver_oid) is soft-deleted or does not exist anymore. The same happens in the backend wherever PageRepository::versionOL() is applied, for example for file references resolved through ResourceFactory::getFileReferenceData().
Such move pointers are not created by the DataHandler of TYPO3 14. Deleting a live record discards its workspace versions. They exist in installations upgraded from older TYPO3 versions, where the live record was deleted while a workspace still held a move of it. One broken row is enough to make every page that renders the record (also through a menu or a shortcut) fail in the workspace preview.
Steps to reproduce
- Create a page “Target” and a workspace with uid 1.
- Create a content element on any page in LIVE and set it to
deleted=1. - Insert a move pointer for it in the workspace, for example:
INSERT INTO tt_content (pid, CType, header, colPos, t3ver_wsid, t3ver_oid, t3ver_state)
VALUES (<uid of Target>, 'text', 'Move pointer', 0, 1, <uid of the deleted element>, 4);
- Switch to the workspace and open the frontend preview of “Target”.
Expected: the page renders, the orphaned move pointer is skipped.
Actual: TypeError, HTTP 500.
Cause
PageRepository::versionOL() re-reads the live record of an incoming move pointer:
$row = $queryBuilder->select(...$fields)
->from($table)
->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter((int)$row['t3ver_oid'], Connection::PARAM_INT)))
->executeQuery()
->fetchAssociative();
...
$wsAlt = $this->getWorkspaceVersionOfRecord($table, $row, $bypassEnableFieldsCheck);
The query keeps the DeletedRestriction, so for a deleted or missing live record fetchAssociative() returns false. Since #108901 (change 90784), getWorkspaceVersionOfRecord() takes the full live record typed as array, so false ends in a TypeError. Before that change, the method received $row['uid'], which only raised a warning for false and then looked up uid 0.
Proposed fix
Return early after the re-read when there is no live record. $row stays false, which the doc comment of versionOL() already defines as “the calling function should act as if the record is forbidden to access”:
if ($row === false) {
// The live version is deleted, so the move pointer has nothing to point to
return;
}
Verified on 14.3.7 and main with a functional test in PageRepositoryTest (live record missing, live record soft-deleted). Without the change both cases end in the TypeError, with the change both pass. A patch against main follows on Gerrit (Releases: main, 14.3).
Reviews 2
Related issues 1
History 26
-
Georg Tiefenbrunn changed Related to #108901 <span data-processor="relativetime" data-value="2026-10-02T11:27:50+00:00" > 10/02/26, 11:27 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 96307 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-02T11:37:51+00:00" > 10/02/26, 11:37 </span> -
Gerrit Code Review pushed patch set 2 for main to change 96307 <span data-processor="relativetime" data-value="2026-10-02T12:44:18+00:00" > 10/02/26, 12:44 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96532 <span data-processor="relativetime" data-value="2026-10-08T12:08:10+00:00" > 10/08/26, 12:08 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 96532 <span data-processor="relativetime" data-value="2026-10-08T12:45:20+00:00" > 10/08/26, 12:45 </span>
-
Anonymous commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-08T13:00:12+00:00" > 10/08/26, 13:00 </span>
Applied in changeset commit:19216e6f2a842d8bc23abfb4d07b656cc0ecae74.