Review main Ready for review

97861[FEATURE] Add placeholder option for TCA selectSingle fields

Nikita Hovratov CR 0 V 0 Hard +471 −2 updated 11/20/26, 15:16

Commit message

Single select fields had no supported way to make editors choose a
value explicitly. The usual workaround, an empty item like "Please
choose", can be selected and saved like any other value. With integer
items, "0" is ambiguous, and an empty string item turns an
automatically generated integer column into VARCHAR.

The new TCA option "placeholder" for select fields with renderType
"selectSingle" fixes this:

    'placeholder' => true,
    'placeholder' => 'my_ext.db:field.placeholder',

"true" uses a generic label provided by TYPO3, a string is used as a
custom label. FormEngine renders the placeholder as an option that is
shown while no value is chosen, but cannot be chosen, so the field is
required. DataHandler rejects an empty value for these fields, while
"0" stays a valid value.

Automatically generated columns of such fields with integer values
are nullable with default NULL, so a record without a chosen value
can be told apart from "0". Columns of string values are unchanged.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 1
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/61/97861/1 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/61/97861/1 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 41

Issues 1

Files 12

Review log 12

  1. Nikita Hovratov uploaded patch set 1 11/20/26, 15:10

  2. core-ci voted on patch set 1 V +1 11/20/26, 15:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/115082