-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Unhelpful fatal error with custom validator #1664
Comments
Could you please submit a test case? |
I don't know how to officially and properly build a test case, so I'll just give you the code I had that was causing the error. Also, I'm using 1.2.4. use Phalcon\Mvc\Model\Validator,
Phalcon\Mvc\Model\ValidatorInterface;
class Dollar extends Validator implements ValidatorInterface
{
public function validate($model)
{
$field = $this->getOption('field');
$value = $model->$field;
if(preg_match('/^\d+(\.\d{2})?$/',$value))
return TRUE;
else{
return FALSE;
}
}
} |
ghost
mentioned this issue
Dec 13, 2013
Could you please check now? |
Yep, it works now. As a side-note, https access of the debug assets (css/js) is broken again. You guys should just include the assets right in the debug error page. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I hesitate to call this a "bug" per se, but it's not really a new feature request. Anyway...
I have built a custom validator. In that validator, when it returns FALSE, I had neglected to append a message. I was then presented with a fatal error saying "the argument is not iterable" - which was fairly close to useless.
I suggest either changing the code so it doesn't choke when no message is appended, or throw a proper exception to help trace where the problem occurred.
The text was updated successfully, but these errors were encountered: