Ticket Details
validation function not called when format is specified
BUG Ticket (closed)
###What happened:
- While trying to specify a format to a custom validator, it seems to skip the validation function
###What was expected:
- When a format is specified it should call the function and pass the format
### My code samples
#### my custom validation:
Validator::add('sampleValid', function(&$value, $format = null, array $options = array()) {
var_dump("format = ", $format, "<br><br>", $options['format'], "<br><br>");
exit();
}
#### my call (without format specified) (validation function called) :
$validations = array(
'inputName' => array(
array('sampleValid', 'message'=> 'this does not work the sample valid')
)
);
return $document->save($this->request->data, array('validate' => $validations));
#### my call (with format specified) (validation function NOT called) :
$validations = array(
'inputName' => array(
array(
'sampleValid',
'message' => 'this does not work the sample valid', 'format' => 'string')
)
);
return $document->save($this->request->data, array('validate' => $validations));
Updates
(fixed)
on 06.03.11
by Howard
- owner was changed to Howard
- status was changed to closed
- resolution was changed to fixed