The discussion addresses a bug where moderators are shown the incorrect reason for why they cannot be deleted. Moin reports that the UI displays “Admins can’t be deleted” for non-admin moderators, which is misleading since moderators can be deleted. Lilly confirms the issue on a test site. tobiaseigen clarifies that the bug is not about deletion permissions but about the wrong reason being displayed to moderators. Moin and tobiaseigen discuss the confusion, and zogstrip notes the fix aims to align the UI with the backend logic.
delete_forbidden_because_staff: “Admins and moderators can’t be deleted.”
I understand that this is helpful because moderators can be deleted. But I have the impression that something was overlooked in this adjustment, which confused me today.
My user is a moderator, but not an admin, and still the note said “Admins can’t be deleted”.
After checking the code, I think I found why this happens: If a user cannot be deleted, there are two possible reasons:
The user is an admin.
The user has posts older than configured.
The real reason why I couldn’t delete my moderator user was [2], but the reason shown is [1], because while moderators were removed from the text of the warning, the code still checked for staff instead of admin.
yea I can repro this on my hosted test site as well. as soon as I delete the posts for my test moderator account, the “admins can’t be deleted” message is replaced by the delete button. thanks for reporting Moin
To clarify further.. a user who is not moderator can’t be deleted and the reason shown is below. The bug is that the wrong reason is shown when the user is a moderator.
Users can’t be deleted if they have posts. Delete all posts before trying to delete a user. (Posts older than 365 days old can’t be deleted.)
Yeah that’s what I meant but got the sentence structure wrong! I think I fixed it now.
All of this said.. I wonder why it is possible to delete moderators. I think it makes sense to demote users before deleting them and have always done that, and not questioned the UI.