From e6fb2cac0cc50e80ee16177db832926da5fdfcf6 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 5 Oct 2012 19:11:50 +0200 Subject: [PATCH] Make runLegacyHooks work around bug in Hooks. Hooks::isRegistered() doesn't consider hooks in $wgHooks. Until that is fixed (see I39bd5de2), we need to check that explicitely. Change-Id: I211c0c8bd0cd618151e56a11171ec8feef328d16 --- includes/content/ContentHandler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index 91da3e8bc0..99ae1673af 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -949,7 +949,9 @@ abstract class ContentHandler { * @return Boolean True if no handler aborted the hook */ public static function runLegacyHooks( $event, $args = array(), $warn = true ) { - if ( !Hooks::isRegistered( $event ) ) { + global $wgHooks; //@todo: once I39bd5de2 is merged, direct access to $wgHooks is no longer needed. + + if ( !Hooks::isRegistered( $event ) && empty( $wgHooks[$event] ) ) { return true; // nothing to do here } -- 2.20.1