Make runLegacyHooks work around bug in Hooks.
authordaniel <daniel.kinzler@wikimedia.de>
Fri, 5 Oct 2012 17:11:50 +0000 (19:11 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Fri, 5 Oct 2012 17:11:50 +0000 (19:11 +0200)
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

index 91da3e8..99ae167 100644 (file)
@@ -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
                }