Review 13.4 Merged

89948[BUGFIX] Respect placeholder configuration in RTE fields

Garvin Hicking CR +2 V +2 Normal +219 −8 updated 06/30/25, 19:13

Commit message

This change streamlines the existing TCA placeholder handling
of type=text to also work for RTE fields (that means when
`enableRichtext` is set), to align with existing input and text
field handling.

It is configured like regular input/text field TCA
(see EXT:styleguide RTE field 'rte_6'):

```
// ...
  'rteColumn' => [
    'label' => 'Some RTE field',
    'config' => [
      'type' => 'text',
      'enableRichtext' => true,
      'default' => null,
      'nullable' => true,
      'mode' => 'useOrOverridePlaceholder',
      'placeholder' => 'Insert contact details here.',
    ],
  ],
// ...
```

Inherited HTML for the placeholder (IRRE) is evaluated as proper
markup within the RTE. Labels only show the "strip_tags()"
variant of possible HTML context.

The logic for displaying placeholders and "defaults" is a bit
unfortunate, because what the UI shows as "Default" is not really
a default, but instead an inherited fallback for a decoupled
rendering process that acts on NULL values.

We should have three terms:

* Placeholder = Something the editor reads and knows what
  to fill in ("Enter file description")
* Default = A value that is actually saved ("NULL" to trigger
  fallback for example, and otherwise the actual string content)
* Fallback = A value that will be used in case the stored value
  is set to NULL

This is something that is to be streamlined across all TextElements.

The patch is meant to make RTE functionality available so that
for example `sys_file_reference` fields can be remapped to
utilize richttext editing and still keep their placeholder/fallback
functionality in place.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
  • Verified V +2 Done
    • Garvin Hicking +2
    • core-ci +1 CI

Issues 1

Files 4

Review log 34

  1. Garvin Hicking commented on patch set 1 06/30/25, 18:57

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 06/30/25, 19:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81149

  3. Garvin Hicking voted on patch set 1 CR +2 V +2 06/30/25, 19:13

  4. Garvin Hicking merged patch set 2 06/30/25, 19:13