#111481Editing a file reference record warns "Array to string conversion" in RecordTypeLabelResolver
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
- Create a content element with an image, so a sys_file_reference record exists.
- 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>
- 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
-
Gerrit Code Review pushed patch set 1 for main to change 97763 status
NewUnder Review <span data-processor="relativetime" data-value="2026-11-17T17:39:26+00:00" > 11/17/26, 17:39 </span> -
Gerrit Code Review pushed patch set 2 for main to change 97763 <span data-processor="relativetime" data-value="2026-11-18T17:09:32+00:00" > 11/18/26, 17:09 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 97799 <span data-processor="relativetime" data-value="2026-11-18T18:26:24+00:00" > 11/18/26, 18:26 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 97799 <span data-processor="relativetime" data-value="2026-11-18T18:44:46+00:00" > 11/18/26, 18:44 </span>
-
Benjamin Kott commented and changed status
Under ReviewResolved done0 %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.