Issue Bug Under Review Quiet

#110888Workspaces module fails with TypeError for a deleted or missing page

Georg Tiefenbrunn 10/02/26, 11:29 updated 10/02/26, 11:37

Description

Problem

In a workspace, opening the Workspaces module (“Publish”) with the id of a deleted page fails with

TypeError
TYPO3\CMS\Backend\Template\Components\DocHeaderComponent::setPageBreadcrumb():
Argument #1 ($pageRecord) must be of type array, null given

Other page modules (Page, List, Preview, Permissions) show their “no page selected” state for the same id. Once #107213 lets a missing page id pass the BackendModuleValidator like a deleted page, editors hit this right after deleting a page created in the workspace. The module state keeps its id, and the next switch to the Workspaces module opens the module with it.

Steps to reproduce

  1. In LIVE, delete a page (it is marked deleted=1).
  2. Switch to a workspace.
  3. Open the Workspaces module with the id of that page, for example through the module state (select the page before deleting it) or with the URL parameter id.

Expected: the module renders without a page breadcrumb, as for the root page.
Actual: TypeError.

Cause

ReviewController::handleRequest() reads the page with

$pageRecord = BackendUtility::getRecord('pages', $pageUid);
...
$view->getDocHeaderComponent()->setPageBreadcrumb($pageRecord);

getRecord() returns null for a deleted or missing page, and setPageBreadcrumb() requires an array. The call was introduced with the breadcrumb API in change “[TASK] Deprecate MetaInformation API” (14.0).

Proposed fix

$pageRecord = BackendUtility::getRecord('pages', $pageUid) ?? [];

Verified on 14.3.7 and main with a new functional test for ReviewController (deleted page, missing page). Without the change both fail with the TypeError, with the change both render. A patch against main follows on Gerrit (Releases: main, 14.3).

Reviews 3

History 12