Issue Bug Closed

#110217RecordFieldPreviewProcessor::prepareFieldWithLabel() ignores CType-specific Page TSconfig overrides for selectSingle item labels

Can Karadag 07/17/26, 13:52 updated 08/11/26, 08:51

Description

Description

When rendering a field with RecordFieldPreviewProcessor::prepareFieldWithLabel(), the displayed label for a select field using renderType = selectSingle does not respect CType-specific Page TSconfig overrides.

The field has three items in its default TCA configuration. For a specific tt_content.CType, the available select items are overridden via Page TSconfig and the field then contains five items.

In the backend edit form, the Page TSconfig override works correctly: the five overridden options are shown and can be selected.

However, when rendering the field in a backend preview using:

$this->fieldProcessor->prepareFieldWithLabel($record, 'my_field');

the selected value is resolved using the default TCA configuration instead of the effective configuration after applying the CType-specific Page TSconfig override. As a result, the preview displays an incorrect label.

Steps to reproduce

  1. Create a tt_content field with a TCA configuration similar to:
'my_field' => [
    'label' => 'My field',
    'config' => [
        'type' => 'select',
        'renderType' => 'selectSingle',
        'items' => [
            ['Default option 1', 'option1'],
            ['Default option 2', 'option2'],
            ['Default option 3', 'option3'],
        ],
    ],
],
  1. Add a CType-specific Page TSconfig override that changes or extends the field items:
TCEFORM.tt_content.my_field.types.my_custom_ctype {
    addItems.option4 = Overridden option 4
    addItems.option5 = Overridden option 5
}
  1. Create a content element with CType = my_custom_ctype.
  2. Select option4 or option5 in the backend form.
  3. Render the field in a custom preview renderer:
$this->fieldProcessor->prepareFieldWithLabel($record, 'my_field');

Actual behavior

The preview resolves the selected value based on the default TCA items configuration.

If the selected value only exists due to the CType-specific Page TSconfig configuration, the preview may show an invalid value or an incorrect/default label.

Expected behavior

RecordFieldPreviewProcessor::prepareFieldWithLabel() should resolve the selected item label using the effective TCA configuration for the current record, including:

  • Page TSconfig of the record’s page
  • CType-specific overrides via TCEFORM.tt_content.<field>.types.<CType>
  • Other relevant FormEngine item processing

This should produce the same label as shown in the backend edit form.

Technical context

RecordFieldPreviewProcessor::prepareFieldWithLabel() internally uses BackendUtility::getProcessedValue() to resolve the human-readable value.

BackendUtility::getProcessedValue() provides optional parameters for the record UID, PID and the complete record row. The PID is used to evaluate Page TSconfig, and the complete row provides additional context, for example for itemsProcFunc processing. [5]

It appears that RecordFieldPreviewProcessor does not pass the required record context to BackendUtility::getProcessedValue(). As a result, the default TCA configuration is used instead of the CType-specific Page TSconfig override.

Environment

Reviews 2

History 28

  1. Can Karadag commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-07-24T07:15:09+00:00" > 07/24/26, 07:15 </span>

    Applied in changeset commit:64755449693523ef5cef8a9674e7ff39cc64d24f.