ZF-7034: Don't get NotEmpty Validator if it's still exists in FiterChain
Description
In Zend_Filter_Input the 'NotEmpty' Validator is always added to the validator chain. We've defined :
$validator = array( 'street' => array ( new Zend_Validate_NotEmpty ( ), new Zend_Validate_Regex ( '/^[a-zA-Z0-9\xC0-\xFF`\'\/.-\s]{1,26}$/u' ), new Zend_Validate_StringLength ( 0, 25 ), Zend_Filter_Input::PRESENCE => Zend_Filter_Input::PRESENCE_REQUIRED, Zend_Filter_Input::DEFAULT_VALUE => '', Zend_Filter_Input::BREAK_CHAIN => true, 'messages' => array ( 0 => 'Bitte geben Sie Ihre Straße ein.', 1 => 'Verwenden Sie bitte keine Sonderzeichen bei der Eingabe.', array ( Zend_Validate_StringLength::TOO_LONG => 'Bitte beschränken Sie sich auf %max% Zeichen' ) )
We would have the error message 0 if street is an empty param, instead of default 'notEmptyMessage'.
Comments
Posted by Thomas Weidner (thomas) on 2009-08-24T08:39:00.000+0000
Can you provide us with a full example ? Your filter settings, calling method and input value so we get the same results.
Posted by Thomas Weidner (thomas) on 2009-08-27T10:40:28.000+0000
Fixed with r17845
Posted by testmwi (testmwi) on 2009-08-28T01:56:26.000+0000
Thank's a lot. I've tested this and it's working fine.