Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Orphaned

93046[FEATURE] Introduce InspectorEditorRegistry for ext:form

Josua Vogel CR 0 V 0 Expert +1963 −200 updated 03/18/26, 14:38

Commit message

Adds a PHP-based registry for form editor inspector editors,
replacing hard-coded templateName checks across multiple extractor
classes with a single registry lookup mechanism.

Technical changes:

New classes and interfaces:
- InspectorEditorInterface: Contract declaring editor capabilities
  (multi-value properties, collection scoping, rich text support,
  property path expansion, select options resolution, Fluid partial)
- AbstractInspectorEditor: Base class with sensible defaults; only
  getFluidPartialName() must be implemented by concrete editors
- InspectorEditorRegistry: Immutable registry populated at container
  compile time, keyed by templateName identifier
- AsFormInspectorEditor: PHP attribute for auto-discovery via DI
- InspectorEditorPass: Symfony compiler pass collecting all tagged
  services into the registry

17 concrete editor classes registered via #[AsFormInspectorEditor]:
  CheckboxEditor, CollectionElementHeaderEditor, CountrySelectEditor,
  FinishersEditor, FormElementHeaderEditor,
  GridColumnViewPortConfigurationEditor, MaximumFileSizeEditor,
  MultiSelectEditor, PropertyGridEditor, RemoveElementEditor,
  RequiredValidatorEditor, SingleSelectEditor, TextEditor,
  TextareaEditor, Typo3WinBrowserEditor, ValidationErrorMessageEditor,
  ValidatorsEditor

Refactored extractors to use registry instead of hard-coded checks:
- FormElement\MultiValuePropertiesExtractor: Delegates to
  editor->getMultiValuePropertyPaths() and
  editor->getAdditionalMultiValueProperties() instead of checking
  against a fixed list of five templateName strings
- FormElement\PropertyPathsExtractor: Calls
  editor->expandPropertyPaths() for viewport placeholder expansion
  instead of checking for Inspector-GridColumnViewPortConfigurationEditor
- FormElement\SelectOptionsExtractor: Uses
  editor->getSelectOptionsPropertyPath() with defensive fallback
  (isValidPath check) for editors not yet in registry
- PropertyCollectionElement\MultiValuePropertiesExtractor: Registry
  lookup with editor->isCollectionScoped() and
  editor->getAdditionalMultiValueProperties()
- PropertyCollectionElement\IsCreatablePropertyCollectionElementExtractor:
  Uses editor->getPropertyCollectionName() to determine finisher/
  validator collection instead of hard-coded templateName matching

Service layer changes:
- ConfigurationService: Receives InspectorEditorRegistry via
  constructor injection; passes it to ExtractorDto for all extractors
- FormDefinitionConversionService: Uses registry to detect RTE-capable
  editors via editor->supportsRichText() instead of hard-coded
  Inspector-TextareaEditor check; uses registry for multi-value
  transformation via editor->needsMultiValueTransformation()
- FormEditorEnrichmentService: Resolves RTE enrichment targets from
  registry instead of hard-coded TextareaEditor check
- FormEditorController: Adds mergeRegistryPartialsIntoFormEditorPartials()
  to additively inject registry-based Fluid partials into the
  formEditorPartials array; adds checkUnregisteredEditorTemplateNames()
  scanning all templateName values in formEditor.editors and
  formEditor.propertyCollections.*.editors against the registry,
  triggering E_USER_DEPRECATED for unregistered identifiers

ExtractorDto changes:
- Carries optional InspectorEditorRegistry reference set by
  ConfigurationService before extraction runs

GridColumnViewPortConfigurationEditor specifics:
- Overrides getMultiValuePropertyPaths() to return [] (this editor
  does not have multi-value semantics)
- Implements expandPropertyPaths() replacing {@viewPortIdentifier}
  placeholders with concrete viewport identifiers from
  configurationOptions.viewPorts

RequiredValidatorEditor specifics:
- Overrides getMultiValuePropertyPaths() to read from
  configurationOptions.validationErrorMessage.propertyPath instead
  of the standard propertyPath key
- Returns propertyCollectionName 'validators'

Backward compatibility:
- Editors not found in the registry fall back to previous behavior
  (property path used as-is, no multi-value support)
- All existing YAML configurations continue to work without changes
- formEditorPartials YAML entries remain functional; registry partials
  are merged additively
- Deprecation (E_USER_DEPRECATED) for any templateName in
  formEditor.editors or formEditor.propertyCollections.*.editors not
  registered via #[AsFormInspectorEditor], independent of naming
  conventions

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 6
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/46/93046/6 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/46/93046/6 && git cherry-pick FETCH_HEAD

Review

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

Issues 1

Files 44

Show 24 more files

Review log 1218

  1. Josua Vogel uploaded patch set 1 03/03/26, 19:12

  2. core-ci voted on patch set 1 V -1 03/03/26, 19:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97215

  3. Josua Vogel uploaded patch set 2 V -1 03/03/26, 19:26

  4. core-ci voted on patch set 2 V -1 03/03/26, 19:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97216

  5. Josua Vogel rebased onto patch set 3 V -1 03/03/26, 20:45

  6. core-ci voted on patch set 3 V +1 03/03/26, 21:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97223

  7. Josua Vogel updated the commit message in patch set 4 V +1 03/04/26, 06:23

  8. core-ci voted on patch set 4 V +1 03/04/26, 06:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97252

  9. Josua Vogel commented on patch set 5 V +1 03/04/26, 16:26

    Published edit on patch set 4.
  10. Josua Vogel commented on patch set 6 03/04/26, 16:28

    Published edit on patch set 5.
  11. core-ci voted on patch set 5 V +1 03/04/26, 16:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97344

  12. core-ci voted on patch set 6 V +1 03/04/26, 17:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97345

  13. Garvin Hicking commented on patch set 6 03/14/26, 20:59

    I would really enjoy having this registration in place because it holds a lot of opportunities. But on the other hand I find it quite nice to only have a single YAML file that I could copy around, without needing to pay attention that there might be a matching PHP class lieing around that takes care of the rendering definition then. So my question is: Should we really deprecate and remove the partialName YAML feature, or intentionally support this longer? (honest, open question)
  14. Josua Vogel commented on patch set 6 03/18/26, 10:09

    Reply

    I've been thinking about this. A developer creating a custom inspector will have several tasks to complete — the partialName alone isn't enough. You also have to create a Fluid template and write JavaScript code. Sure, the overall process could be improved in the long run, but the lack of an option to set the partialName in YAML isn't really a major limitation.
  15. Garvin Hicking commented on patch set 6 03/18/26, 10:42

    Reply

    Yeah but then you'll add PHP to the mix of things you need to address. Especially now that you've made it easier to not necessarily need JavaScript for a definition. And fluid partials could be re-used, so you might not necessarily need to create new partials for new inspectors, if your partial is flexible enough...?
  16. Josua Vogel commented on patch set 6 03/18/26, 10:52

    Reply

    I think you mix things up :) I made it easier for custom form elements, but not for the inspectors (the interface elements to edit select options,...).
  17. Garvin Hicking commented on patch set 6 03/18/26, 11:03

    Reply

    Hah, you are right. See, that's why you are the form master and I'm your padawan. I'll consider this one resolved, I understand your intent. However, I can't really judge it.
  18. Josua Vogel marked it work in progress 03/18/26, 14:38