Issue Bug Resolved

#111013TCA default values of fields outside the type's showitem are no longer applied

Wolfgang Klinger 10/11/26, 06:14 updated 10/12/26, 09:05

Description

Problem

Since #101435 (commit 4930c561853) DataHandler takes the fields of a new record from the type-specific sub-schema. A sub-schema only contains the fields of the type’s showitem.

As a result, newFieldArray() no longer sets the TCA default value of a column that is not part of the record type’s showitem. The record gets the SQL column default instead. In 13.4 newFieldArray() went through all columns of the table.

Affected: main and 14.3.

How to reproduce

Functional test, tt_content on a page with uid 1:

$GLOBALS['TCA']['tt_content']['columns']['imageborder']['config']['default'] = 1;
$this->get(TcaSchemaFactory::class)->rebuild($GLOBALS['TCA']);

$dataHandler->start(['tt_content' => ['NEW1' => ['pid' => 1, 'CType' => 'text', 'header' => 'test']]], [], $backendUser);
$dataHandler->process_datamap();

Expected: imageborder = 1
Actual: imageborder = 0 (imageborder is not in the showitem of CType “text”)

Same result without “CType” in the data, because the default type is used then.

Related

#104646: a columnsOverrides default for a passthrough field works since #101435 when the field is in the type’s showitem.

Proposal

newFieldArray() goes through all columns of the table again and uses the sub-schema field where the type overrides it. The other places that use the sub-schema fields (copy, uniqueInPid, uniqueInSite) are not touched.

Reviews 2

History 36

  1. Wolfgang Klinger commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-12T09:05:11+00:00" > 10/12/26, 09:05 </span>

    Applied in changeset commit:bf675772615155b592f0f70827a6ed90e3050326.