Page MenuHomePhabricator

Pass the relevant and necessary context information to UserBlockedError
Closed, ResolvedPublic

Description

UserBlockedError passes the global request context to the block methods that format errors.

We can improve on this:

  • Only the user, language and IP are needed
  • These should be passed in by the caller where possible (i.e. Actions, EditPage, SpecialPages)

We should make these improvements after the block formatter service is introduced in T227174.

Event Timeline

Change 538452 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] Allow user, language and IP to be passed to UserBlockedError

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

Change 538452 merged by jenkins-bot:
[mediawiki/core@master] Allow user, language and IP to be passed to UserBlockedError

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

dom_walden subscribed.

As part of T227007#5598774 I tested how block error messages look in most of the places in the code that we changed, including in different languages. Missing, I think, SpecialRevisionDelete and SpecialUserrights.

I have briefly tested SpecialRevisionDelete and SpecialUserrights on test as an admin with a database block on my user.