Hello,

Just checking if someone has the same problem after upgrading from 2.2.2 to
2.2.3.
I have a form with validation. After upgrading, the not required fields, are
suddenly required.
Just a part of the code:


        $this->inputFilter = new InputFilter();
        $factory = new InputFactory();

        $this->inputFilter->add(
            $factory->createInput(
                array(
                     'name'       => 'website',
                     'required'   => false,
                     'filters'    => array(
                         array('name' => 'StripTags'),
                     ),
                    'validators'  => array(
                        array(
                            'name'  => 'Uri',
                            'options'   => array(
                                'uriHandler' => "\Zend\Uri\Http",
                                'messages'   => array(
                                    Uri::NOT_URI => "The input does not
appear to be a valid Url",
                                )
                            )
                        )
                    )
                )
            )
        );


I found something in the 'Form' class, 'attachInputFilterDefaults' method.
Fields like 'email', 'url' are instances of InputProviderInterface and then
he gets getInputSpecification() ... And that will overwrite my settings. I
can fix this with setting 'preferFormInputFilter' on true. But I didn't have
to do that in 2.2.2 so ... 




--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/zend-framework-2-2-3-non-required-form-fields-not-working-anymore-tp4660795.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to