Page MenuHomePhabricator

API:Block invalid page restriction should return warning rather than fatal error
Open, Needs TriagePublicBUG REPORT


What is the problem?

If I use the API to block a from a non-existent page, the API returns a fatal error which blocks completion of the request.

We should do the same thing we do for invalid namespaces: just return a warning but otherwise complete the request.

Steps to reproduce problem
  1. Submit a request like:

Expected behavior: Request is successful (block is created) but some sort of warning like {'warnings': {'block': {'*': 'Unrecognized value for parameter "pagerestrictions": nonexistentpage'}}...
Observed behavior: {"error": {"code": "cant-block-nonexistent-page"...


Wiki(s): MediaWiki 1.37.0-alpha (5d4d08b) 09:09, 11 May 2021