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
[5.0] New Feature - Change user before delete #40751
Conversation
Add the configuration tab to com_users for the new functionality: Change user before delete
Add the user plugin for the new functionality to change the user ID on several extensions. To allow 3rd party extensions to use this, a new plugin group is implementet.
I still have one question: |
please review the submitted code to ensure that the copy pasted copyright and doc blocks have been updated for the submitted code |
please review the xml additions to ensure that they match the codestyle of the rest of the xml file |
before you do this, we have to talk about the concept and the usecases and if they fit the needs of us and 3rd party extensions |
in that case this is my comment to say that in its current form it should be an extension and not something for the core as in the real world this will be more of a pia than a problem solver. it doesnt take into account if the user has authored any content or even if the user was an approved user and not a fake spam registration |
I would love to have such a feature because currently I struggle with lots of websites where I get the error that the user id was not found. |
In additioning to the previous comments: For some inspiration see #40553, there you will find good examples of the coding to be used. |
f3ba5e6
to
2b51826
Compare
I made alternative fix, please test #41048 |
Tested this feature and I like it very much. I am very happy to have it now. Hope it finds the way in Core. Had many sites where I had to fix this manually in the database. |
This pull request has been automatically rebased to 5.1-dev. |
I have tested it but it does not work correctly. The deleted user is still assigned to the article with the ID but does not replace it with the chosen one. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40751. |
Can you finish this, so that we can test this during PBF? |
@degobbis I would love the Feature in 5.1 :-) |
I am closing this, we discussed this today and came to the conclusion that we want to go a different way. We think it is better to anonymise the user data instead of hard delete a user account. With this we not only fix it for com_content, also other extensions don't run into the problem of not existing user account. Essentially we do what we do in other areas and trash user accounts instead of delete. There will be an option for remove a user from the database, this will come with a warning that there can be site effects. Thank you Guido for proposing this feature and working on this. |
Too bad, I just finished the fix, including the action log. |
@rdeutz Will this different way handle the Author rights (copyrights as said in PR intro)? |
Summary of Changes
As a feature often requested in the German community and solved by me with a plugin, I was asked by @tecpromotion, @coolcat-creations and some others to bring the feature into the core. So here is my tribute.
It opens the possibility to define a user to be used as a replacement when another user is deleted. As long as this user is entered as a replacement, it cannot be deleted itself.
This affects extensions that use users, such as
com_content
. Here it may also be necessary for copyright reasons that the original creator is still named. Therefore there is an option to enter the name of the user to be deleted as an alias.All core tables in the database are searched for the user to be deleted and the user ID as well as the alias are adjusted according to the settings,
To make the whole thing also usable for other developers, a plugin group
beforedeleteuser
was added.This makes it flexibly extendable, so that only an installable plugin with the necessary information is needed to implement the own extension.
Testing Instructions
At this point I can only say, test all possible scenarios to delete a user. There are countless, so I will not list them all here.
Actual result BEFORE applying this Pull Request
After deleting a user, the user ID remains in all core extensions, such as "com_content" and you get nasty warnings when editing an entry.
Expected result AFTER applying this Pull Request
Of course, only where this is also offered by the extension.
Known Issue:
For large websites it may timeout, but the user is not deleted then.
So far I have not been able to intercept this server message in such a way that a message is displayed which entries have already been processed and that the deletion has to be triggered again to process the rest.
Maybe someone has an idea how this can be solved.