Project

General

Profile

Actions

Bug #100301

closed

Undefined array key for form fields of type checkbox

Added by David Bruchmann about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Start date:
2023-03-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

Defining a form like this

type: Form
prototypeName: standard
identifier: variant-Test
label: Newsletter Subscription
renderables:
  -
    type: Page
    identifier: page-1
    label: General data
    renderables:
      -
        type: Text
        identifier: email-address
        label: Email address
        defaultValue:
        variants:
          -
            identifier: validation-1
            condition: 'formValues["checkbox-1"] == 1'
            properties:
              fluidAdditionalAttributes:
                required: required
            validators:
              -
                identifier: NotEmpty
              -
                identifier: EmailAddress
      -
        type: Checkbox
        identifier: checkbox-1
        label: Check this and email will be mandatory

throws an error when the checkbox is not checked:
PHP Warning: Undefined array key "checkbox-1" in /var/www/html/vendor/symfony/expression-language/Node/GetAttrNode.php line 97

Select fields with empty value option behave probably similar.
I'm not sure if all cases would be covered then.

Actions

Also available in: Atom PDF