Page MenuHomePhabricator

Deprecate global-blocks-specific methods and hook
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

MediaWiki core has some specific handling for global blocks, which are added via the GlobalBlocking extension. However, core should be unaware of features added by extensions.

They are:

  • User::isBlockedGlobally - to find out if a user is blocked, use User::getBlock instead, which will now include global blocks. Or to do something specific with a global block (from an extension), use the GlobalBlocking extension directly. Code in MediaWiki core should not have special handling for global blocks.
  • User::getGlobalBlock - as above
  • The UserIsBlockedGlobally hook (run from User::getGlobalBlock) - to add any kind of block, use the GetUserBlock hook instead.
  • The SystemBlock type global-block (also from User::getGlobalBlock) - GlobalBlocks are now added into CompositeBlocks via the GetUserBlock hook
  • Related tests/wiring

After T317334: Remove separate checks for global blocks from PasswordReset and T317325: Remove separate checks for global blocks from APIUpload and SpecialUpload, global blocks are no longer separately checked for from core, so the methods and hook can be deprecated, and any references to global blocks that can be removed should be.

Acceptance criteria

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
OpenSpikeNone
ResolvedCyndymediawiksim
ResolvedCyndymediawiksim
ResolvedCyndymediawiksim
Resolved AGueyte
Resolved TThoabala
ResolvedDreamy_Jazz
Resolved AGueyte
ResolvedWMDE-Fisch
Resolved AGueyte
ResolvedCyndymediawiksim
ResolvedCyndymediawiksim
OpenNone
ResolvedTchanders
ResolvedTchanders
Resolved AGueyte
ResolvedSTran

Event Timeline

Tchanders renamed this task from Deprecate global-blocks-specific methods and hook in core to Deprecate global-blocks-specific methods and hook.Sep 8 2022, 4:11 PM
Tchanders set the point value for this task to 3.Oct 11 2022, 5:41 PM
TThoabala changed the point value for this task from 3 to 2.Oct 26 2022, 4:38 PM

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

[mediawiki/core@master] Deprecate global-blocks-specific methods and hook

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

Tchanders updated the task description. (Show Details)
Tchanders updated the task description. (Show Details)

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

[mediawiki/core@master] Deprecate global-blocks-specific methods and hook

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

@AGueyte @Cyndymediawiksim @Tchanders This looks like it hasn't merged.

Change 851091 merged by jenkins-bot:

[mediawiki/core@master] Deprecate global-blocks-specific methods and hook

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