Review main Merged

93082[BUGFIX] Use empty stepType in variant conditions when currentPage is null

Josua Vogel CR +2 V +2 Normal +164 −3 updated 03/15/26, 07:18

Commit message

The condition resolver in FormRuntime::getConditionResolver() used a
fallback to the first form page (getPageByIndex(0)) when currentPage
was null. This caused the `stepType` variable to incorrectly resolve
to "Page" (the type of the first page) in two scenarios:

1. During FormRuntime::initialize(), where processVariants() is called
   before initializeCurrentPageFromRequest() sets the current page.
   At this point currentPage is always null, so stepType was always
   evaluated as "Page" regardless of the actual target page.

2. In the finisher context, where currentPage is null because the last
   page has been submitted. Here stepType was also incorrectly set to
   "Page" instead of an empty string.

As a result, variant conditions like `stepType == "Page"` would
incorrectly match on SummaryPage steps and during finisher execution,
causing elements with `enabled: false` and a variant that sets
`enabled: true` for `stepType == "Page"` to be shown everywhere.

The fix removes the fallback to getPageByIndex(0) and instead sets
both stepIdentifier and stepType to empty strings when currentPage
is null. This ensures variant conditions based on stepType only match
when the form is actually on a page of the corresponding type.

Review

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

Issues 1

Files 2

Review log 57

  1. Josua Vogel uploaded patch set 1 03/05/26, 13:33

  2. Josua Vogel uploaded patch set 2 03/05/26, 13:38

  3. core-ci voted on patch set 2 V +1 03/05/26, 13:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97409

  4. core-ci voted on patch set 1 V +1 03/05/26, 14:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97408

  5. Garvin Hicking voted on patch set 2 CR +1 V +1 03/14/26, 21:05

  6. Georg Ringer voted on patch set 2 CR +2 V +2 03/15/26, 07:18

  7. Georg Ringer merged patch set 3 03/15/26, 07:18