Skip to content

[Form] RepeatedType does not allow invalid_options  #22593

Closed
@tina-junold

Description

@tina-junold
Q A
Bug report? yes
Feature request? no
BC Break report? -
RFC? -
Symfony version 3.2.7

I'm currenty testing my application and i've wrote an change password form which uses the RepeatedType.

        $builder
            ->add(
                'new',
                RepeatedType::class,
                [
                    'type'            => PasswordType::class,
                    'required'        => false,
                    'first_name'      => 'new',
                    'second_name'     => 'repeated',
                    'first_options'   => [
                        'label' => 'form.type.change_password.new.label',
                    ],
                    'second_options'  => [
                        'label' => 'form.type.change_password.repeated.label',
                    ],
                    'invalid_message' => 'form.type.change_password.new.invalid_message',
                ]
            );

In the documentation (and elsewere) it supports the option invalid_message but the test fails with:

  1. ChangePasswordTypeTest::testBuildForm
    Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException: The option "invalid_message" does not exist. Defined options are: "action", "attr", "auto_initialize", "block_name", "by_reference", "compound", "data", "data_class", "disabled", "empty_data", "error_bubbling", "first_name", "first_options", "inherit_data", "label", "label_attr", "label_format", "mapped", "method", "options", "post_max_size_message", "property_path", "required", "second_name", "second_options", "translation_domain", "trim", "type", "upload_max_size_message".

    /project/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php:685
    /project/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php:95
    /project/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php:85
    /project/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php:106
    /project/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php:256
    /project/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php:122

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions