Page MenuHomePhabricator

Remove OAuthReplaceMessage hook
Closed, ResolvedPublic

Description

	/**
	 * Run hook to override a message keys that might need to be changed
	 * across all sites in this cluster.
	 * @param string $msgKey the Message key
	 * @return string the Message key to use
	 */
	public static function getSiteMessage( $msgKey ) {
		wfRunHooks( 'OAuthReplaceMessage', &$msgKey );
		return $msgKey;
	}

I'm not sure what value this really brings... We can override in WikimediaMessages (WikimediaMessagesHooks::onMessageCacheGet) rather than using this

	$wgHooks['OAuthReplaceMessage'][] = function ( &$msgKey ) {
		if ( $msgKey === 'mwoauth-form-privacypolicy-link' ) {
			$msgKey = 'wikimedia-oauth-privacy-link';
		}
		return true;
	};

I don't think this adds anything; any wiki that requires this functionality can just use MessageCache::get in almost exactly the same way

	$wgHooks['MessageCache::get'][] = function ( &$msgKey ) {
		if ( $msgKey === 'mwoauth-form-privacypolicy-link' ) {
			$msgKey = 'wikimedia-oauth-privacy-link';
		}
		return true;
	};

Event Timeline

Reedy created this task.Jun 2 2020, 11:32 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 2 2020, 11:32 PM
Reedy updated the task description. (Show Details)Jun 2 2020, 11:44 PM
Reedy updated the task description. (Show Details)Jun 2 2020, 11:48 PM
Tgr awarded a token.Jun 2 2020, 11:59 PM
Reedy renamed this task from Deprecate and remove OAuthReplaceMessage hook to Remove OAuthReplaceMessage hook.Jun 3 2020, 12:06 AM

Change 601914 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/OAuth@master] Remove OAuthReplaceMessage hook

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

Jdforrester-WMF closed this task as Resolved.Jun 25 2020, 6:16 PM
Jdforrester-WMF assigned this task to Reedy.

Change 601914 merged by jenkins-bot:
[mediawiki/extensions/OAuth@master] Remove OAuthReplaceMessage hook

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