-
Notifications
You must be signed in to change notification settings - Fork 341
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
Rule {} does not have an error message #180
Comments
Could you detail your problem please? |
I'm getting the same error and I'm running it on PHP 7.0.15. I've extended GUMP into my own class and within it I call the run method and if it fails then I call the get_errors_array method to carry out my own error message processing. It's throwing the following error within that method:
I've tried to debug it myself and I can't seem to work out what's going on with it. Within the get_errors_array method there's a "foreach ($this->errors as $e)" loop and dumping the messages array up until the error is thrown, it shows the messages array just fine, but just before it throws it dumps the variable as a bool(true). It's an odd one... |
Update: I finally figured out what was going on. If you validate 1 set of data and then validate another set which is completely different, using a separately initialised GUMP object (in my case I have validation taking place across several different models), then that's when it throws the error. It's happening due to the the language file being included using require_once, within the get_messages method - line 522. As it's already been included the first time, when the validation is run on the second validation it returns bool(true) rather than the array of messages, as I was dumping out. If I include the method within my extended class, update the path variables to the file and then change this from "require_once" to "require" it no longer throws the error. I hope that helps. |
Thank you very much @lchambers ! Fixed on commit 616ba9c. |
Gump keeps randomly raising the error on get_readable_errors.
It is just random - one second it can find the message the other cannot.
The text was updated successfully, but these errors were encountered: