Review 13.4 Merged

90407[TASK] Add `getSoftReferenceKeys()` method to Schema Field API

Oli Bartsch CR +2 V +2 Hard +268 −2 updated 08/15/25, 13:17

Commit message

This introduces a new method `getSoftReferenceKeys()` to the
`FieldTypeInterface` that allows programmatic detection of fields
with soft reference configurations. This enables automatic
discovery of fields containing soft references without manual
maintenance of field lists.

The method returns:
- `false` if soft references are not supported by the field type or
  no softRef configuration key exists at all
- `array` (possibly empty) when softRef configuration is present

The explicit `false` return value is necessary to distinguish between:
- Field types that cannot / should not have soft references (returns false)
- Field types that support soft references but have no parsers configured
  (returns empty array)
- Field types with actual soft reference parsers (returns parser keys array)

This distinction allows consumers to differentiate between "soft
references not supported" vs "soft references supported but not
configured", which is important for components like LinkValidator
that need to know whether to even consider soft references on a field.

Key changes:
- Added `getSoftReferenceKeys(): array|false` to FieldTypeInterface
- Implemented default logic in AbstractFieldType to parse comma-separated
  `softRef` configuration using `GeneralUtility::trimExplode()`
- Override method to return `false` for field types that logically
  can't contain soft references (checkbox, number, passthrough, etc.)

This change enables components like LinkValidator to automatically
discover fields with soft reference configurations, making manual
declaration of TSconfig "searchFields" obsolete.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
  • Verified V +2 Done
    • Oli Bartsch +2
    • core-ci +1 CI

Issues 1

Files 27

Show 7 more files

Review log 34

  1. Oli Bartsch uploaded patch set 1 08/15/25, 10:43

  2. core-ci voted on patch set 1 V +1 08/15/25, 10:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83450

  3. Oli Bartsch voted on patch set 1 CR +2 V +2 08/15/25, 13:17

  4. Oli Bartsch merged patch set 2 08/15/25, 13:17