Fix broken calls to ArticleDelete hook.
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 29 Jan 2009 01:04:00 +0000 (01:04 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 29 Jan 2009 01:04:00 +0000 (01:04 +0000)
includes/FileDeleteForm.php
includes/api/ApiDelete.php

index 3af9813..5177d35 100644 (file)
@@ -108,7 +108,8 @@ class FileDeleteForm {
                                $id = $title->getArticleID( GAID_FOR_UPDATE );
                                // Need to delete the associated article
                                $article = new Article( $title );
-                               if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ) {
+                               $error = '';
+                               if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, &$error)) ) {
                                        if( $article->doDeleteArticle( $reason, $suppress, $id ) ) {
                                                global $wgRequest;
                                                if( $wgRequest->getCheck( 'wpWatch' ) ) {
index 8a4040d..a892b1c 100644 (file)
@@ -137,9 +137,10 @@ class ApiDelete extends ApiBase {
                        if($reason === false)
                                return array(array('cannotdelete'));
                }
-               
-               if (!wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)))
-                       $this->dieUsageMsg(array('hookaborted'));
+
+               $error = '';
+               if (!wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, $error)))
+                       $this->dieUsageMsg(array('hookaborted', $error));
 
                // Luckily, Article.php provides a reusable delete function that does the hard work for us
                if($article->doDeleteArticle($reason)) {