Skip to content
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: Model::getValidationRules() cant handle ::$validationRules if its a string #3039

Closed
element-code opened this issue May 27, 2020 · 0 comments · Fixed by #3040
Closed
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@element-code
Copy link
Contributor

Describe the bug
When calling CodeIgniter\Model::getValidationRules() (as described here) we get a TypeError or a error from array_diff_key or array_intersect_key in case were using options.
This is caused by ::getValidationRules not checking for string / lookup like it happens in ::validate().

Always using ::getValidationRules instead of internal accessing them in ::validate() would be better and minimize the possibility of not checking for is_string :)

CodeIgniter 4 version
development

Affected module(s)
Codeigniter\Model

@element-code element-code added the bug Verified issues on the current code behavior or pull requests that will fix them label May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant