Page MenuHomePhabricator

The 'globalblock' API will indicate local block is a success even if it fails
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

The globalblock API does not use the returned Status by BlockUser::placeBlock in the response sent back to the user. This means that, even if the local block failed, the user reading the response will not see this and could be led to believe the block was a success.

Steps to replicate the issue (include links if applicable):

  1. Load Special:ApiSandbox while logged into a user with the globalblock right but not the block right
  2. Choose globalblock as the action
  3. Enable the alsolocal option and enter a target

What happens?:
The API responds with blockedlocally set as true

What should have happened instead?:
The API response should not indicate that the local block was successful and instead display the error for why the block did not succeed

Event Timeline

Change #1037112 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@master] [WIP] Support global account blocks in 'globalblocks' API

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

Change #1037112 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Support global account blocks in 'globalblock' API

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

I have verified the new code has been implemented and is functioning and displaying as expected... Good Work @Dreamy_Jazz!!!

image.png (651×1 px, 58 KB)

image.png (737×1 px, 69 KB)