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

Review main Work in progress Stale

94571[WIP][BUGFIX] Re-evaluate form variants per step and make them revertible

Josua Vogel CR 0 V -1 Hard +329 −4 updated 06/24/26, 21:10

Commit message

Conditional variants (e.g. `condition: 'stepType == "Page"'`) corrupted
the validation and step evaluation of form elements once a validator was
involved:

* Validators of conditionally enabled elements were never executed.
  `FormRuntime::initialize()` runs `processVariants()` before the current
  page is resolved, so `stepType` evaluates to an empty string and a
  `stepType == "Page"` variant never matches. The element stays disabled
  and `mapAndValidatePage()` skips it during validation.

* Variant application was irreversible. `RenderableVariant::apply()`
  merged its options into the renderable without any way to undo them,
  and `processVariants()` only applied matching variants without
  reverting non-matching ones. A state set during the premature
  (step-less) pass leaked into later passes, which broke inverted
  conditions like `stepType != "Page"` (element disabled on its own page,
  rendered on the summary page).

Variant processing is now idempotent: before each pass all previously
applied variants are reverted to the captured base state and only the
currently matching variants are re-applied. `RenderableVariant` captures
the variant-relevant state (label, renderingOptions, properties,
defaultValue, validators) on apply and restores it on the new `revert()`
method. In addition, `processVariants()` and `getConditionResolver()`
accept an explicit step page so submitted values are validated against
the variant state of the actually displayed page.

All touched classes and interfaces (`RenderableVariant`,
`RenderableVariantInterface`, `AbstractRenderable`) are `@internal`; the
`FormRuntime` changes only add optional parameters to protected methods,
so the change is not breaking for public API.

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

Review

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

Issues 2

Files 6

Review log 23

  1. Josua Vogel uploaded patch set 1 06/24/26, 14:57

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

  3. Josua Vogel marked it work in progress 06/24/26, 21:10