Page MenuHomePhabricator

Return information to help with block message call-to-action in ApiBlockInfoTrait::getBlockDetails
Closed, ResolvedPublic

Description

In order to solve T259774, MobileFrontend needs to know the following about a block:

  1. Is the block sitewide or partial?
  2. Is the block an IP block that also blocks logged in users from that IP (i.e. is it a hardblock)?
  3. Does the block prevent account creation?

MobileFrontEnd gets the block details from ApiBlockInfoTrait::getBlockDetails, which currently does not answer questions (2) and (3). We can update it to include this information.

Event Timeline

Change 621591 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] ApiBlockInfoTrait: Add some extra basic block details

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

Change 621591 merged by jenkins-bot:
[mediawiki/core@master] ApiBlockInfoTrait: Add some extra basic block details

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

dom_walden added a subscriber: dom_walden.

For actions like API:Edit, API:Move, the API returns blockpartial, blocknocreate and/or blockanononly as appropriate for single and composite blocks, but not system blocks.

For example, response from API when attempting to edit a page:

...
"error": {
        "code": "blocked",
        "info": "You have been blocked from editing this page.",
        "blockinfo": {
            "blockid": 12466,
            "blockedby": "Dom walden",
            "blockedbyid": 16150,
            "blockreason": "",
            "blockedtimestamp": "2020-08-24T12:31:39Z",
            "blockexpiry": "2020-08-31T12:31:39Z",
            "blockpartial": "",
            "blocknocreate": "",
            "blockanononly": ""
        },
...

Test environments:

Niharika closed this task as Resolved.Oct 2 2020, 7:43 PM