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

Review main Ready for review Quiet

94572[TASK] Resolve EXT:form variants lazily per step

Josua Vogel CR 0 V 0 Expert +1231 −135 updated 10/15/26, 11:04

Commit message

Rendering variants of EXT:form were applied by mutating the affected
renderable in-place: label, rendering options, properties, default value
and validators were overwritten whenever variants were processed. Since
variant application used merge semantics and was never reverted, the
state could not be re-evaluated reliably on a per-step basis.

Variants now act as a declarative overlay. The base state of a
renderable stays immutable with regard to variants. The form runtime
sets a request-scoped variant context for the relevant step, and the
renderable getters resolve the effective value on demand by overlaying
the patches of all variants whose condition matches the context.

The merge semantics that were previously duplicated across the option
setters are centralized in VariantOptionResolver. A VariantContext value
object bundles the step-scoped condition resolver and is stored on the
FormDefinition; AbstractRenderable, AbstractFormElement and FormDefinition
consult it in getLabel(), getRenderingOptions(), getTemplateName(),
isEnabled(), getProperties(), getDefaultValue() and getValidators().

Variant validators are now added on top of an element's base validators
for the matching step (instead of replacing them) and are applied
transiently during validation via an optional, backwards compatible
argument of ProcessingRule::process().

The former in-place mutation path is removed. All affected symbols are
@internal: RenderableVariant::apply()/isApplied(),
RenderableVariantInterface::apply()/isApplied(),
AbstractRenderable::applyVariant() and FormRuntime::processVariants() no
longer exist.

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

Review

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

Issues 2

Files 16

Review log 1629

Show 34 earlier messages
  1. Josua Vogel uploaded patch set 1 06/24/26, 15:43

  2. Josua Vogel marked it work in progress 06/24/26, 15:43

  3. Josua Vogel uploaded patch set 2 06/24/26, 15:48

  4. core-ci voted on patch set 1 V -1 06/24/26, 15:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103824

  1. core-ci voted on patch set 2 V +1 06/24/26, 16:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103825

  2. Josua Vogel uploaded patch set 3 V +1 06/24/26, 16:20

  3. core-ci voted on patch set 3 V +1 06/24/26, 16:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103826

  4. Josua Vogel uploaded patch set 4 V +1 06/24/26, 18:57

  5. core-ci voted on patch set 4 V -1 06/24/26, 19:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103829

  6. Josua Vogel uploaded patch set 5 V -1 06/24/26, 19:06

  7. Josua Vogel uploaded patch set 6 06/24/26, 19:07

  8. core-ci voted on patch set 6 V -1 06/24/26, 19:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103831

  9. core-ci voted on patch set 5 V -1 06/24/26, 19:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103830

  10. Josua Vogel uploaded patch set 7 V -1 06/24/26, 19:35

  11. core-ci voted on patch set 7 V -1 06/24/26, 19:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103832

  12. Josua Vogel uploaded patch set 8 V -1 06/24/26, 20:41

  13. core-ci voted on patch set 8 V -1 06/24/26, 20:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103833

  14. Josua Vogel uploaded patch set 9 V -1 06/24/26, 20:58

  15. core-ci voted on patch set 9 V +1 06/24/26, 21:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103834

  16. Josua Vogel marked it ready for review 06/24/26, 21:09

  17. Josua Vogel rebased onto patch set 10 V +1 07/03/26, 17:02

  18. core-ci voted on patch set 10 V +1 07/03/26, 17:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104320

  19. Josua Vogel uploaded patch set 11 V +1 09/24/26, 15:25

  20. core-ci voted on patch set 11 V -1 09/24/26, 15:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109169

  21. Josua Vogel uploaded patch set 12 V -1 09/24/26, 15:49

  22. core-ci voted on patch set 12 V -1 09/24/26, 15:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109172

  23. Josua Vogel uploaded patch set 13 V -1 09/25/26, 06:33

  24. core-ci voted on patch set 13 V +1 09/25/26, 06:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109223

  25. Lina Wolf commented on patch set 13 10/15/26, 11:04

    The form manual on main was re-indented in https://review.typo3.org/c/Packages/TYPO3.CMS/+/96702 (two spaces after "..", 4-space levels, headline levels). This change will probably conflict in typo3/sysext/form/Documentation when rebased. The script used for the conversion can help to bring new text into the same format; ask me if you need it.