Page MenuHomePhabricator

Echo notificationCategories usergroups parameter disappears
Closed, ResolvedPublic

Description

[[https://github.com/wikimedia/mediawiki-extensions-OAuth/blob/c88313c245e1f428dfa2003b0cefc86b12d6e2e5/frontend/MWOAuthUI.hooks.php#L183|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.

Event Timeline

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 claimed this task.