#101455Form variants including a check on stepType == "Page" are always true, even in finishers and SummaryPage
Description
I have a custom Form Element defintion, having the following rendering options with variants. It should always be disabled but has a variant that enables it on “Page” steps.
renderingOptions:
enabled: false
variants:
- identifier: showOnlyOnPages
renderingOptions:
enabled: true
condition: 'stepType == "Page"'
With this configuration the field is always rendered, however, also in finishers and on the SummaryPage!
When changing the condition to stepType == "NotExistingType" it is never shown, not on Page, not on SummaryPage, not in finishers. So the condition itself is actually evaluated somewhat correctly. But why do SummaryPage and finishers are considered to be of step type “Page”? I can’t imagine this to be correct behaviour.
Reviews 3
Related issues 1
History 913
-
S P commented <span data-processor="relativetime" data-value="2023-07-27T07:17:43+00:00" > 07/27/23, 07:17 </span>
In
FormRuntime::getConditionResolver, called byprocessVariants(), I see this:$page = $this->getCurrentPage() ?? $this->getFormDefinition()->getPageByIndex(0);So, even in finishers you are basically on a stepType “Page”. And for the “SummaryPage” this happens because
processVariants()is also called frominitialize(), but BEFORE the currentPage is initialized.This means:
processVariants()is always executed twice. Always atinitialize()( before the current stepType is known and falls back to Page then) and then either when rendering (on summary page it is then “SummaryPage”) or when finishing (it is then “Page”). But the firstinitialize()call already makesstepType == "Page"always true in any case. -
S P commented <span data-processor="relativetime" data-value="2023-07-27T07:21:47+00:00" > 07/27/23, 07:21 </span>
My current workaround is this: field always enabled, but disable on non-Page steps and when any finisher is executed. This seemingly covers all cases, but you never know. Having it work “forward” instead of “backwards” would be better.
variants: - identifier: showOnlyOnPages renderingOptions: enabled: false condition: 'stepType != "Page" || finisherIdentifier != ""' -
S P commented and changed TYPO3 Version
1213 <span data-processor="relativetime" data-value="2024-12-19T10:37:12+00:00" > 12/19/24, 10:37 </span>Bug still present on v13.
-
Gerrit Code Review pushed patch set 1 for main to change 93082 status
NewUnder Review <span data-processor="relativetime" data-value="2026-03-05T13:34:02+00:00" > 03/05/26, 13:34 </span> -
Gerrit Code Review pushed patch set 2 for main to change 93082 <span data-processor="relativetime" data-value="2026-03-05T13:38:09+00:00" > 03/05/26, 13:38 </span>
-
Josua Vogel commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-03-15T07:20:09+00:00" > 03/15/26, 07:20 </span>Applied in changeset commit:1ce678db9362e5ee4757baa24eeb485751c5cfb5.
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 93196 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2026-03-16T06:49:02+00:00" > 03/16/26, 06:49 </span> -
Gerrit Code Review pushed patch set 2 for 13.4 to change 93196 <span data-processor="relativetime" data-value="2026-03-16T06:55:28+00:00" > 03/16/26, 06:55 </span>
-
Josua Vogel commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2026-03-16T07:25:10+00:00" > 03/16/26, 07:25 </span>Applied in changeset commit:02283c14819f6290336b9770546a38c36a8060d0.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-03-31T09:00:35+00:00" > 03/31/26, 09:00 </span>
Using the inverse (always enabled, disable on specific conditions) is no option for me, because I want to disable it in every finisher and step Type, except Page! So I can not just query for
'stepType == "SummaryPage" || finisherIdentifier in ["EmailToSender", "EmailToReceiver"]'because this would enable it in custom finsishers and custom page types that are not explicitly in this exclusion-list.