Page MenuHomePhabricator

Refactor logic for doing and logging unblock out of SpecialUnblock so it can be easily reused elsewhere
Closed, ResolvedPublic

Description

T248640 is a hot candidate for this class.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 588104 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/core@master] Introduce backend classes for (un)blocking users

https://gerrit.wikimedia.org/r/588104

Change 592287 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/core@master] [WIP] Introduce BlockValidator service for validating block targets

https://gerrit.wikimedia.org/r/592287

Change 592288 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/core@master] WIP: Introduce backend class for unblocking users

https://gerrit.wikimedia.org/r/592288

CCicalese_WMF subscribed.

It doesn't look like Platform Engineering is currently actively involved in code review for this task. If code review is needed, please feel free to re-tag with Platform Engineering.

Change 592288 merged by jenkins-bot:
[mediawiki/core@master] Introduce backend class for unblocking users

https://gerrit.wikimedia.org/r/592288

dom_walden subscribed.

Tested unblocking various types of blocks with Special:Unblock and API:Unblock. Checked the database to see that the block (and its restrictions) get removed correctly.

Tested that permissions block, unblockself and hideuser were correctly applied for Special:Unblock and API:Unblock.

The only difference I could see is that previously if you tried to unblock a hidden user without the hideuser right, the error message was: You cannot unblock this user, as their username has been hidden.

After this change, it is: You are not allowed to execute the action you have requested.

Tested some form validation, including trying to unblock a user who wasn't blocked and a non-existent user.

Checked that the unblocking events were correctly recorded in Special:Log.

Test environments:

Tchanders subscribed.

The only difference I could see is that previously if you tried to unblock a hidden user without the hideuser right, the error message was: You cannot unblock this user, as their username has been hidden.

After this change, it is: You are not allowed to execute the action you have requested.

Filed as T261761

Change 628126 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/core@master] Hard deprecate SpecialUnblock::processUnblock

https://gerrit.wikimedia.org/r/628126

Change 628136 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/core@master] [tests] Remove SpecialUnblock::processUnblock calls in SpecialUnblockTest

https://gerrit.wikimedia.org/r/628136

Change 628136 merged by jenkins-bot:
[mediawiki/core@master] [tests] Remove SpecialUnblock::processUnblock calls in SpecialUnblockTest

https://gerrit.wikimedia.org/r/628136

Change 628126 merged by jenkins-bot:
[mediawiki/core@master] Hard deprecate SpecialUnblock::processUnblock

https://gerrit.wikimedia.org/r/628126

Boldly closing, as there shouldn't be anything else to do.