-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
New Plugin Events onUserBeforeDataValidation #10351
Conversation
The new event allows to hock into the validation of the user data, it allows user plugins to change request data and e.g. an easy way of implement something like registerWithEmail.
I strongly disagree with this. We have an API for this stuff https://docs.joomla.org/Server-side_form_validation with JFormFieldRule - this PR is encouraging bad practice. At validation of data you should NEVER be modifying the form definition OR the data itself - it should be done in the existing plugin event |
This hasn't to do with validation it allows manipulation and this is need when you try to implement something like this #10347 |
I have seen that plugin and in there you are not using |
We can remove the onUserAfterDataValidation I only though it might be good to have a change to get the validation result and maybe to access some of the error messages. For the other event you can move it but then it will not work because the validation works on the requestdata see https://github.com/joomla/joomla-cms/blob/staging/components/com_users/controllers/registration.php#L137 and you can't manipulate this in onContentPrepareForm, here you get plain nothing beside the default group mapping |
@pe7er Peter if you have a chance can you take a look here if this addition would allow you to write the plugin you tried to write, thanks. |
@rdeutz Ok, I will do so when I can make some time (which is not before JAB16) |
See #10751 |
Summary of Changes
The new event allows to hock into the validation of the user data, it allows user plugins to change request data and e.g. an easy way of implement something like registerWithEmail.
Can be merged on review