moodle-tool_mergeusers icon indicating copy to clipboard operation
moodle-tool_mergeusers copied to clipboard

Deleted users appear in search results

Open leonstr opened this issue 1 year ago • 3 comments

When searching users to select which accounts to merge deleted users appear:

usersearch

In this screenshot we see user 99, a normal user, user 100 which has been deleted, and user 101 which has been suspended.

If there is a use-case for merging with deleted accounts the search results should indicate this, similar to how suspended accounts are greyed. The current appearance is confusing unless the site admin is familiar with the changes Moodle makes to mdl_user.username and mdl_user.email when deleting a user.

If there is no use-case for merging with deleted accounts then deleted users should be excluded from the search results.

leonstr avatar Jul 23 '24 12:07 leonstr

Thanks for the reporting @leonstr .

This is unitentional. Deleted users should not be listed. Any of the other users must be listed. Imagine you merge 2 users in the inverse order. So, proceeding with the inverse merging operation should leave things as they should initially. So, for this reason, only suspended and non suspended users must be listed.

If you believe you can report a patch to solve this, it would be easier and quicker to get solved. Otherwise, we get it recorded to address it when we have availability.

Thanks a lot in advance,

Jordi

jpahullo avatar Jul 24 '24 07:07 jpahullo

@jpahullo The commit for the PR to fix #275 is built upon the commit to fix this issue as 1) they're directly related, and 2) they both touch the same code. I hope these two changes are not confusing!

leonstr avatar Jul 24 '24 16:07 leonstr

Ok about your above comment. Thanks a lot for working on it!

Please, close the PR that finally is not useful by now by your own, so I finally do not get confused in the future.

Let me know analyse the PR #276 then.

Thanks again.

Jordi

jpahullo avatar Jul 24 '24 16:07 jpahullo

Hi @leonstr ,

Included on MOODLE_405_STABLE branch ONLY.

Closing as fixed.

Thanks a lot for your work.

Jordi

jpahullo avatar Aug 14 '25 07:08 jpahullo