Page MenuHomePhabricator

Remove getPermissionsError from GlobalBlock
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

AbstractBlock::getPermissionsError is deprecated and just calls the BlockErrorFormatter in most block classes. GlobalBlock still uses it to add a custom error message, but it appears that the method is never called: https://codesearch.wmcloud.org/search/?q=getPermissionsError&i=nope&files=&excludeFiles=&repos=

Acceptance criteria
  • GlobalBlock::getPermissionsError is removed
Notes

Documentation on the deprecation/removal process: https://www.mediawiki.org/wiki/Stable_interface_policy#Deprecation_process

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptSep 7 2022, 2:56 PM

FWIW https://gerrit.wikimedia.org/r/c/mediawiki/core/+/824142 would reintroduce a call to this method. In general I think it's the only way to get an error message for a global block; the only reason it's not used is that nothing tries to show an error message for a global block currently (except the permission system, which uses a different hook). But it's a legitimate use case.

T317201: Allow extensions to modify block error message key via a hook would fully obsolete the method, though.

Tchanders set the point value for this task to 1.Oct 11 2022, 5:46 PM

Change 853926 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GlobalBlocking@master] Remove getPermissionsError from GlobalBlock

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

Change 853926 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Remove getPermissionsError from GlobalBlock

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