Issue Bug Closed

#107432RuntimeException when creating new workspace version of sys_file_metadata records as editor

Stefan Froemken 09/11/25, 07:09 updated 08/11/26, 08:46

Description

Hello,

when creating a new workspace version of a sys_file_metadata record as a backend editor, TYPO3 throws a RuntimeException.

This happens because TYPO3 tries to check page permissions for the record. During this process, TYPO3 extracts the pid of the record and fetches the corresponding pages record from the database. However, sys_file_metadata records always have pid = 0. As a result, the database query for the pages record returns an empty array. Since this array does not contain a pid field, TYPO3 raises an exception.

Steps to reproduce

  1. Log in to the TYPO3 backend as an editor (non-admin). Editor has no LIVE workspace access and is assigned as valid user to a workspace.
  2. Navigate to the Filelist module.
  3. Select a file and open its metadata (from table sys_file_metadata).
  4. Change a value like title or description
  5. Save the records (which will try to create a new version of the metadata record).

Expected behavior

Creating a new workspace version of sys_file_metadata should work without errors. Since metadata records always have pid = 0, TYPO3 should handle this case gracefully without attempting to fetch a related pages record.

Actual behavior

TYPO3 throws the following exception:

(1/1) #1578950324 RuntimeException

The given page record is invalid. Missing uid.
in /vendor/typo3/cms-core/Classes/Authentication/BackendUserAuthentication.php line 329

Stack trace excerpt:

at TYPO3\CMS\Core\Authentication\BackendUserAuthentication->isInWebMount(array())
in /vendor/typo3/cms-core/Classes/DataHandling/DataHandler.php line 7620
...
at TYPO3\CMS\Core\DataHandling\DataHandler->hasPagePermission(1, array())

Additional information

The issue only occurs for editors (non-admin users).

sys_file_metadata records are always stored on pid = 0, which makes the page permission check invalid in this context.

As a result, TYPO3 receives an empty array instead of a valid pages record, leading to the RuntimeException.

Reviews 12