Project

General

Profile

Actions

Bug #101768

closed

TYPO3 Form - Page Variant Condition

Added by Dennis Leibold about 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2023-08-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Bug in the description of cms-form
Page: https://docs.typo3.org/c/typo3/cms-form/main/en-us/I/Concepts/Variants/Index.html#hide-steps

Variant conditions for page types must have an additional condition, if formValues are checked. Else the condition will fail because the array key is not set yet.

Before:

type: Page
identifier: page-2
label: Second step
variants:
  -
    identifier: variant-2
    condition: 'formValues["checkbox-1"] == 1'
    renderingOptions:
      enabled: false

Fixed:

type: Page
identifier: page-2
label: Second step
variants:
  -
    identifier: variant-2
    condition: 'formValues && formValues["checkbox-1"] == 1'
    renderingOptions:
      enabled: false

Actions #1

Updated by Dennis Leibold about 1 year ago

  • Description updated (diff)
Actions #2

Updated by Mathias Brodala about 1 year ago

You can use the known traverse() function:

condition: 'traverse(formValues, "checkbox-1") == 1'
Actions #3

Updated by Henrik Elsner 11 months ago

IMHO Mathias already provided the solution.
No patch is needed for the core, but the docs.
I created a PR, which might already be enough at this point.
https://github.com/TYPO3/typo3/pull/473

Actions #4

Updated by Gerrit Code Review 11 months ago

  • Status changed from New to Under Review

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82186

Actions #5

Updated by Gerrit Code Review 11 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82128

Actions #6

Updated by Anonymous 11 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack 4 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF