Issue Bug Closed

#101768TYPO3 Form - Page Variant Condition

Dennis Leibold 08/28/23, 10:00 updated 07/09/24, 15:19

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

Reviews 2

History 57

  1. Dennis Leibold changed description 08/28/23, 10:02

  2. Mathias Brodala commented 09/28/23, 07:57

    You can use the known traverse() function:

    condition: 'traverse(formValues, "checkbox-1") == 1'
  3. Henrik Elsner commented 12/14/23, 12:47

    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

  4. Gerrit Code Review pushed patch set 3 for main to change 82186 status New Under Review 12/15/23, 22:33

  5. Gerrit Code Review pushed patch set 1 for 12.4 to change 82128 12/18/23, 10:18

  6. Anonymous commented and changed status Under Review Resolved done 0 % 100 % 12/18/23, 10:35

    Applied in changeset commit:38063d6e38e6c2a16cee6056b7d0a9665199cb31.

  7. Benni Mack changed status Resolved Closed 07/09/24, 15:19