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

New Plugin Events onUserBeforeDataValidation #10351

Closed
wants to merge 1 commit into from

Conversation

rdeutz
Copy link
Contributor

@rdeutz rdeutz commented May 9, 2016

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

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.
@wilsonge
Copy link
Contributor

wilsonge commented May 9, 2016

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 onContentPrepareForm.

@wilsonge wilsonge closed this May 9, 2016
@rdeutz
Copy link
Contributor Author

rdeutz commented May 9, 2016

This hasn't to do with validation it allows manipulation and this is need when you try to implement something like this #10347

@rdeutz rdeutz reopened this May 9, 2016
@wilsonge
Copy link
Contributor

wilsonge commented May 9, 2016

I have seen that plugin and in there you are not using onUserAfterDataValidation and as far as I can tell the code in onUserBeforeDataValidation could be moved into onContentPrepareForm without affecting anything

@rdeutz
Copy link
Contributor Author

rdeutz commented May 9, 2016

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

@rdeutz
Copy link
Contributor Author

rdeutz commented May 12, 2016

@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.

@pe7er
Copy link
Contributor

pe7er commented May 12, 2016

@rdeutz Ok, I will do so when I can make some time (which is not before JAB16)

@wilsonge wilsonge mentioned this pull request Jun 7, 2016
@wilsonge
Copy link
Contributor

wilsonge commented Jun 7, 2016

See #10751

@wilsonge wilsonge closed this Jun 7, 2016
@wilsonge wilsonge mentioned this pull request Jan 18, 2017
@rdeutz rdeutz deleted the add_user_plugin_event branch February 20, 2020 22:33
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

Successfully merging this pull request may close these issues.

4 participants