Page MenuHomePhabricator

Echo notificationCategories usergroups parameter disappears
Closed, ResolvedPublic

Description

MWOAuthUIHooks::onBeforeCreateEchoEvent contains this snippet:

$notificationCategories['oauth-admin'] = array(
	'tooltip' => 'echo-pref-tooltip-oauth-admin',
	'usergroups' => $wgOAuthGroupsToNotify,
);

This works locally in vagrant, but not on meta - $wgOAuthGroupsToNotify is empty.

tgr@terbium:~$ mwscript eval.php --wiki=metawiki

> var_export($wgOAuthGroupsToNotify);
array (
  0 => 'oauthadmin',
)

> var_export($wgEchoNotificationCategories['oauth-admin']);
array (
  'tooltip' => 'echo-pref-tooltip-oauth-admin',
  'usergroups' => 
  array (
  ),
)

> \MediaWiki\Extensions\OAuth\MWOAuthUIHooks::onBeforeCreateEchoEvent( $not, $cat, $i );
> var_export( $cat['oauth-admin'] );
array (
  'tooltip' => 'echo-pref-tooltip-oauth-admin',
  'usergroups' => 
  array (
    0 => 'oauthadmin',
  ),
)

Maybe related to the fact that Oauth uses extension registration but Echo does not. BeforeCreateEchoEvent is called from ExtensionFunctions though, which should in theory be late enough so not sure what is going on.

Details

Related Gerrit Patches:
operations/mediawiki-config : masterDo not use $wgExtensionFunctions to set globals

Event Timeline

Tgr created this task.Aug 15 2016, 9:53 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 15 2016, 9:53 PM
Tgr updated the task description. (Show Details)Aug 15 2016, 9:58 PM
Tgr updated the task description. (Show Details)

Change 307893 had a related patch set uploaded (by Gergő Tisza):
Do not use $wgExtensionFunctions to set globals

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

Change 307893 merged by jenkins-bot:
Do not use $wgExtensionFunctions to set globals

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

Mentioned in SAL [2016-09-06T23:14:48Z] <dereckson@tin> Synchronized wmf-config/CommonSettings.php: Do not use $wgExtensionFunctions to set globals (T143055) (duration: 00m 47s)

Tgr closed this task as Resolved.Sep 6 2016, 11:17 PM
Tgr claimed this task.