joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.79k stars 3.66k forks source link

UX problem in delete joomla user groups that have users with only one usergroup #35880

Open sabersaberi2 opened 3 years ago

sabersaberi2 commented 3 years ago

Steps to reproduce the issue

1-create joomla user group and set Group parent to Public. 2- set some users with that user group only 3- delete that user group 4- go to each user profile that you assign to that group 5- you can not save or update that users until set at least one user group.

Expected result

can not delete user groups that have users with only one group such as when you can not delete (not trash) category of article if there is some or one article in that category.

Actual result

you can delete each group that have some user even with one usergroup and in this way that user becomes an orphan user. then: 1- you can not find which user has not any usergroup with default joomla Search Tools. 2- you can not save this user in anyway of joomla default User component

System information (as much as possible)

Additional comments

brianteeman commented 3 years ago

You did have to confirm that you wanted to delete the group that contained users

2- you can not save this user in anyway of joomla default User component

Can not confirm

sabersaberi2 commented 3 years ago

Can not confirm

My means you can not save any change or in other word you can not update user until set a group for him.

brianteeman commented 3 years ago

What is the UX problem? You get the appropriate messages and warnings.

sabersaberi2 commented 3 years ago

What is the UX problem?

in first step, how you can find the users without any usergroup via normal Search Tools or any way in joomla?

brianteeman commented 3 years ago

The question should be - why ignore the advice not to remove a group that contains users

sabersaberi2 commented 3 years ago

The administrator may need to delete a user group for any reason. Do we have a ban on deleting groups in Joomla because of this problem? Suppose I manage my users for a while with a group of plugins like rsmember, but from now on I want to manage my users myself. This was an example, but the main problem persists. The question is, for whatever reason this happened, even one of the managers made a mistake. Or another example: I have 2,000 users in that group and I do not know that some of them may have only one user group and I also need to delete that group because there is special access for that group, for example in hikashop or any plugin No longer set. By deleting that user group, I almost lose those users who have only one user group. I can not find them later. This may be similar to the relationship between Article and Article Category, but this process(user and usergroup) differs from the presence of a Article in the Category.

richard67 commented 3 years ago

Maybe it could be a solution to assign those users which would be without any group to the default group for new users (typically registered, can be configured in com_user options)?

brianteeman commented 2 years ago

I see the problem now. If you try to delete a group containing users then you are prompted that you are deleting a group with users and asked to confirm. BUT the check is only if there are users in the group it does not check if any child groups have users.

So if you have a group "parent" with no users and a subgroup "child" that does have users you are able to delete the parent group without a warning and the child group is deleted as well.

the query that gets the total numbers of users in the group needs to be expanded to include any child groups