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

Multi + DataValidator + custom validators not usable #12

Open
AlexP11223 opened this issue May 20, 2021 · 2 comments
Open

Multi + DataValidator + custom validators not usable #12

AlexP11223 opened this issue May 20, 2021 · 2 comments

Comments

@AlexP11223
Copy link
Contributor

Looks like using Multi with DataValidator and custom validators (inside both of them) with custom error codes is not possible.

Both Multi with DataValidator call logger, which then checks error codes.

So

  • if custom logger (with new messages) is passed to both of them - duplicated messages.
  • if only Multi (or DataValidator) has the custom logger - the other one throws exception because its' default logger doesn't recognize custom error codes.

(I need DataValidator inside Multi because besides the form fields I need to validate the whole request to detect too big file uploads, but I guess it can be reproduced with other combinations too)

@AlexP11223 AlexP11223 changed the title Multi + DataValidator+ custom validators not usable Multi + DataValidator + custom validators not usable May 20, 2021
@gmazzap
Copy link
Contributor

gmazzap commented May 20, 2021

@AlexP11223 it seems you know the codebase better than me, I don't use this since long time and last time I worked on something here was 4 years ago. So... do you have any proposal or idea how this can work?

@AlexP11223
Copy link
Contributor Author

No proposal :(
This "logging" stuff seems quite confusing and complex to me.

Also found some other problems:

  • DataValidator skips non-existing fields, no way to make it required.
  • Something unclear with messages possibly related to inclusion of field name in messages by default, maybe solvable via error templates.

Probably will switch to https://github.com/Dhii/validator for now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants