Issue Bug Resolved

#111481Editing a file reference record warns "Array to string conversion" in RecordTypeLabelResolver

Benjamin Kott 11/17/26, 17:38 updated 11/18/26, 19:10

Description

Problem

Opening the edit form of a sys_file_reference record emits the PHP warning “Array to string conversion” in RecordTypeLabelResolver::resolve(). With a strict error handler the form does not render.

Steps to reproduce

  1. Create a content element with an image, so a sys_file_reference record exists.
  2. Open the edit form of that sys_file_reference record directly, e.g. via the list module or /typo3/record/edit?edit[sys_file_reference][<uid>]=edit.</uid>
  3. See the warning “Array to string conversion” in RecordTypeLabelResolver.php.

Cause

sys_file_reference takes its record type from the related file (ctrl.type = 'uid_local:type'). RecordTypeLabelResolver::resolve() ignores the foreign part of the type pointer and casts the value of the local field uid_local to string. In the row processed by FormEngine, a group field is a list of relation items, so the first entry is an array. For a select pointer such as sys_file_metadata (file:type), the uid of the related record is taken as the type value. FormEngine (DatabaseRecordTypeValue) and BackendUtility::getTCAtypeValue() instead read the type field of the related record.

Reviews 2

History 15

  1. Benjamin Kott commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-18T19:10:10+00:00" > 11/18/26, 19:10 </span>

    Applied in changeset commit:c8a3e96e91675edff0d5616a0936ff96944d4aaa.