Details
-
Type:
Patch
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.8.4
-
Fix Version/s: 1.9.1
-
Component/s: Zend_Validate
-
Labels:None
Description
In the current release validator chains loose the context parameter, making it impossible to use in Zend_Form:
require_once 'Zend/Validate.php'; require_once 'Zend/Validate/Abstract.php'; class XYZValidator extends Zend_Validate_Abstract { public function isValid($value, $context = null) { return $value == 'value' && is_array($context) && array_diff($context, array('foo' => 'bar')) === array(); } } $validate = new Zend_Validate(); $validate->addValidator(new XYZValidator()); var_dump($validate->isValid('value', array('foo' => 'bar'))); // should be true but is false
My patch
- enables passing arbitrary count of parameters to the validator chain proxying those parameters to the validators.
- has been unit-tested to not break BC.
- provides a unit-test to check for those context parameters.
Attachments
Issue Links
| This issue duplicates: | ||||
| ZF-6506 | No mention of isValid context variable in new docs |
|
|
|
Closing as Won't Fix as for the same reason as mentioned within
ZF-6506.ZF-6506.