Page MenuHomePhabricator

Fix a gotcha with hook handlers order
Closed, ResolvedPublic

Description

	/**
	 * @FIXME This is terrible
	 */
	public static function onExtensionFunctions() {
		global $wgHooks;
		// Register this as late as possible!
		$wgHooks['GetPreferences'][] = 'GlobalPreferencesHooks::onGetPreferences';
	}

This will work only until there's another extension that wants to be the last. We should probably introduce another hook that would allow to process already fully built preferences array.

Event Timeline

This will no longer be required after T173476, because we'll override the Preferences class and so can inject things to Preferences::getPreferecnes().

MaxSem assigned this task to Samwilson.