? Success

User tests: Successful: Unsuccessful:

avatar rdeutz
rdeutz
9 May 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

avatar rdeutz rdeutz - open - 9 May 2016
avatar rdeutz rdeutz - change - 9 May 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 May 2016
Labels Added: ?
avatar wilsonge
wilsonge - comment - 9 May 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.

avatar wilsonge wilsonge - change - 9 May 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-05-09 10:02:14
Closed_By wilsonge
avatar wilsonge wilsonge - close - 9 May 2016
avatar wilsonge wilsonge - close - 9 May 2016
avatar rdeutz
rdeutz - comment - 9 May 2016

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

avatar rdeutz rdeutz - change - 9 May 2016
Status Closed New
Closed_Date 2016-05-09 10:02:14
Closed_By wilsonge
avatar rdeutz rdeutz - change - 9 May 2016
Status New Pending
avatar rdeutz rdeutz - reopen - 9 May 2016
avatar rdeutz rdeutz - reopen - 9 May 2016
avatar zero-24 zero-24 - change - 9 May 2016
Category Plugins
avatar wilsonge
wilsonge - comment - 9 May 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

avatar rdeutz
rdeutz - comment - 9 May 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

avatar rdeutz
rdeutz - comment - 12 May 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.

avatar pe7er
pe7er - comment - 12 May 2016

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

avatar wilsonge
wilsonge - comment - 7 Jun 2016

See #10751

avatar wilsonge wilsonge - change - 7 Jun 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-06-07 20:47:10
Closed_By wilsonge
avatar wilsonge wilsonge - close - 7 Jun 2016

Add a Comment

Login with GitHub to post a comment