Zend Framework

Don't get NotEmpty Validator if it's still exists in FiterChain

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.3
  • Fix Version/s: 1.9.3
  • Component/s: Zend_Filter_Input
  • Labels:
    None

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'.

Issue Links

Activity

Hide
Thomas Weidner added a comment -

Can you provide us with a full example ?
Your filter settings, calling method and input value so we get the same results.

Show
Thomas Weidner added a comment - Can you provide us with a full example ? Your filter settings, calling method and input value so we get the same results.
Hide
Thomas Weidner added a comment -

Fixed with r17845

Show
Thomas Weidner added a comment - Fixed with r17845
Hide
testmwi added a comment -

Thank's a lot. I've tested this and it's working fine.

Show
testmwi added a comment - Thank's a lot. I've tested this and it's working fine.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: