Permalink
Browse files

trigger_error

added a trigger_error instruction when try to load a non existing
method or non existing custom validation class as suggested by
@markstory
  • Loading branch information...
1 parent 25fa3ef commit 101d4868aa949f91dc1d6d9d66dfca22067cef7f @marcopeg marcopeg committed Oct 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Model/Validator/CakeValidationRule.php
@@ -283,7 +283,7 @@ public function process($field, &$data, &$methods) {
if (class_exists($className) && method_exists($className, $method)) {
$this->_valid = call_user_func_array(array($className, $method), $this->_ruleParams);
} else {
- $this->_valid = false;
+ trigger_error(__d('cake_dev', 'Could not find custom validation rule %s', $this->_rule ), E_USER_WARNING);
}
} elseif (is_string($validator['rule'])) {
$this->_valid = preg_match($this->_rule, $data[$field]);

0 comments on commit 101d486

Please sign in to comment.