Reputation: 2577
I wrote a plugin for joomla that adds custom fields to the user/register component. There are 3 different registration forms for different user groups.
The plugin acts on onUserAfterSave()
and works fine, but there is one problem. When there is an error in the original user component, for example: "the username has already been taken" the form is redirected and neither onUserAfterSave()
or onUserBeforeSave()
is ever called.
I want to change that redirection, but without changing the core, but since neither plugin events are called, im not sure how to. Can you guys help me? Maybe I am missing something!
Is it possible to maybe override the save() function?
THANKS
Upvotes: 0
Views: 1297
Reputation: 922
The only clean way to extend the user registration/profile is to create a profile plugin like this one
https://github.com/joomla/joomla-cms/blob/master/plugins/user/profile/profile.php
You can extend com_users forms in backend and frontend.
Upvotes: 0
Reputation: 2012
I had same problem many times, so i can share a solution i use myself. If you don't want to edit Joomla core files, you can do the following:
It's totally Joomla update proof, so you can update your joomla version witht worrying about errors.
Upvotes: 2
Reputation: 479
I think you might need to do the checks that joomla is doing in your plugin and redirect in your plugin itself in the case that it wont pass. I see your predicament and I don't know a better way but I would pick a different event to run it on maybe even after page load and then on UI event in javascript.
Upvotes: 0