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

URI validation happens outside modal window #838

Open
hvelarde opened this issue Sep 28, 2018 · 6 comments
Open

URI validation happens outside modal window #838

hvelarde opened this issue Sep 28, 2018 · 6 comments

Comments

@hvelarde
Copy link
Member

hvelarde commented Sep 28, 2018

Entering an invalid URI on a Banner or Basic tile results on validation outside the edit tile modal.

screenshot_2018-09-28 teste site 2

screenshot_2018-09-28 teste site

@hvelarde hvelarde added the bug label Sep 28, 2018
@hvelarde hvelarde assigned hvelarde and unassigned hvelarde Sep 28, 2018
@hvelarde
Copy link
Member Author

hvelarde commented Sep 28, 2018

This seems to be an issue with the custom edit form; I have no idea how to fix it.

Using a constraint is not an option as its code is never reached.

@idgserpro
Copy link
Member

All validations have this problem. Don't know if using a constraint would even solve it, since using a validator in an adapter factory implementation using validator.WidgetValidatorDiscriminators gives the same problem.

The problem really is worse than validation being outside modal: if you click save after fixing the errors, then you're redirected to the tile view itself, with absolute no layout rendering.

@idgserpro
Copy link
Member

This seems to be an issue with the custom edit form; I have no idea how to fix it.

Doing a raise Exception('EXCEPTION') right after this line:

self.status = self.formErrorsMessage

Keeps the modal opened. Don't know if there' s a "propagation" method or approach that would raise the validations but still in the modal window.

@Mubra
Copy link
Member

Mubra commented Nov 21, 2019

hi @idgserpro and @hvelarde , I was going through the issues and I think I have an idea to close this, HTML5 handles RegExp validators, I think this can be used to validate the form without closing the modal

Screenshot_48

@Mubra Mubra pinned this issue Nov 21, 2019
@idgserpro
Copy link
Member

@Mubra validation has to be server side. And we can have more complex validations than patterns.

@hvelarde
Copy link
Member Author

I like @Mubra idea: it can easily catch 80% of errors without having to wait for server side validation; the only issue is the implementation has to be done upstream on z3c.form

@erral erral unpinned this issue Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants