Page MenuHomePhabricator

UserGroupsChanged hook needs the performer to be specified
Closed, ResolvedPublic2 Story Points

Description

Currently, it is used in in AuthPluginPrimaryAuthenticationProviderTest.php but no performer is specified, therefore when Notifications is enabled the test fails with this error message:

1) MediaWiki\Auth\AuthPluginPrimaryAuthenticationProviderTest::testOnUserGroupsChanged
Missing argument 4 for EchoHooks::onUserGroupsChanged(), called in /var/www/html/includes/Hooks.php on line 177 and defined

/var/www/html/extensions/Echo/Hooks.php:703
/var/www/html/includes/Hooks.php:177
/var/www/html/includes/Hooks.php:205
/var/www/html/tests/phpunit/includes/auth/AuthPluginPrimaryAuthenticationProviderTest.php:76
/var/www/html/tests/phpunit/MediaWikiTestCase.php:416
/var/www/html/maintenance/doMaintenance.php:95

Of note, if the performer is provided, then you get an error for "Missing argument 5" (i.e. reason must also be provided). A default value for $reason should be added here.

Details

Event Timeline

Huji claimed this task.Nov 12 2017, 1:52 AM
Huji created this task.
Huji added a project: Notifications.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptNov 12 2017, 1:52 AM

Change 390850 had a related patch set uploaded (by Huji; owner: Huji):
[mediawiki/core@master] UserGroupsChanged hook should specify the performer of the change

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

Change 390851 had a related patch set uploaded (by Huji; owner: Huji):
[mediawiki/extensions/Echo@master] Set a default value for $reason in onUserGroupsChanged

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

Change 390851 merged by jenkins-bot:
[mediawiki/extensions/Echo@master] Set a default value for $reason in onUserGroupsChanged

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

Change 391148 had a related patch set uploaded (by Huji; owner: Huji):
[mediawiki/core@master] UserGroupsChanged documentation updated

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

Change 391148 abandoned by Huji:
UserGroupsChanged documentation updated

Reason:
As per comment

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

Change 390850 merged by jenkins-bot:
[mediawiki/core@master] UserGroupsChanged hook should specify the performer of the change

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

Huji closed this task as Resolved.Nov 16 2017, 12:45 PM
Huji removed a project: Patch-For-Review.
Huji moved this task from Backlog to In progress on the Notifications board.Nov 16 2017, 12:46 PM