Issue Bug Closed

#97028Validators not removed when variant applies

Helmut Hummel 02/24/22, 17:39 updated 02/24/22, 18:04

Description

Given state

Given there is a form element definition, that has two validators configured and a variant definition that matches and overrides the validators.

Expectation

all validators are removed and new variant validators are applied

Actual

only the first validator is removed and the variant validators are added on top

Verified with TYPO3 11

Example form to reproduce

type: Form
identifier: testformWizardElements
label: 'Testform'
prototypeName: standard
renderingOptions:
    submitButtonLabel: Submit
renderables:
    -   type: Page
        identifier: page-1
        label: Step
        renderingOptions:
            previousButtonLabel: 'Previous step'
            nextButtonLabel: 'Next step'
        renderables:
            -   type: Text
                identifier: text-3
                label: Text3
                defaultValue: '1234567'
                validators:
                    -   identifier: Integer
                    -   identifier: StringLength
                        options:
                            minimum: '1'
                            maximum: '6'
                variants:
                    -   identifier: 'text-3-change-validator'
                        condition: '1 === 1'
                        validators:
                            -   identifier: Integer
                            -   identifier: StringLength
                                options:
                                    minimum: '2'
                                    maximum: '9'

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.