Page MenuHomePhabricator

Remove deprecated Function User::getEffectiveGroups
Closed, DuplicatePublic

Description

After Updating from MW 1.36 to 1.37 the following error occurs:

Use of User::getEffectiveGroups was deprecated in MediaWiki 1.35. [Called from MediaWiki\Extensions\Lockdown\Hooks::onGetUserPermissionsErrors in /var/www/html/extensions/Lockdown/src/Hooks.php at line 123] in /var/www/html/includes/debug/MWDebug.php on line 375

The Release Notes for MW 1.35 says:

The following methods of the User class are deprecated: getGroups, getGroupMemberships, getEffectiveGroups, getAutomaticGroups, addGroup, removeGroup, getFormerGroups, getAllGroups, getImplicitGroups, addAutopromoteOnceGroups. Use the new UserGroupManager service instead.

So the extensions seems to be not working anymore.

Event Timeline

So the extensions seems to be not working anymore.

If it does not work anymore, then there is a different reason. (Deprecation does not mean removal.)

Aklapper renamed this task from Deprecated Function to Remove deprecated Function User::getEffectiveGroups.Dec 6 2021, 1:09 PM
Aklapper added a project: Technical-Debt.

So the extensions seems to be not working anymore.

If it does not work anymore, then there is a different reason. (Deprecation does not mean removal.)

That is correct: in 1.37, the extension should still work, but log warnings. However, the method has been removed on the development branch now, and the extension will stop working in 1.38, unless the issue is fixed.

The deprecation message say to use UserGroupManager::getUserEffectiveGroups instead, so that would be the appropriate fix.

(Note: I'm the original author of the Lockdown extension, but I have not been maintaining it for a decade or so).