Page MenuHomePhabricator

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


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

Change #1037112 merged by jenkins-bot:

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