r46507 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46506‎ | r46507 | r46508 >
Date:01:04, 29 January 2009
Author:werdna
Status:ok
Tags:
Comment:
Fix broken calls to ArticleDelete hook.
Modified paths:
  • /trunk/phase3/includes/FileDeleteForm.php (modified) (history)
  • /trunk/phase3/includes/api/ApiDelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiDelete.php
@@ -137,10 +137,11 @@
138138 if($reason === false)
139139 return array(array('cannotdelete'));
140140 }
141 -
142 - if (!wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)))
143 - $this->dieUsageMsg(array('hookaborted'));
144141
 142+ $error = '';
 143+ if (!wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, $error)))
 144+ $this->dieUsageMsg(array('hookaborted', $error));
 145+
145146 // Luckily, Article.php provides a reusable delete function that does the hard work for us
146147 if($article->doDeleteArticle($reason)) {
147148 wfRunHooks('ArticleDeleteComplete', array(&$article, &$wgUser, $reason, $article->getId()));
Index: trunk/phase3/includes/FileDeleteForm.php
@@ -108,7 +108,8 @@
109109 $id = $title->getArticleID( GAID_FOR_UPDATE );
110110 // Need to delete the associated article
111111 $article = new Article( $title );
112 - if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ) {
 112+ $error = '';
 113+ if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, &$error)) ) {
113114 if( $article->doDeleteArticle( $reason, $suppress, $id ) ) {
114115 global $wgRequest;
115116 if( $wgRequest->getCheck( 'wpWatch' ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r69754$this isn't valid in a static function. Fix for r46507...reedy21:44, 22 July 2010

Status & tagging log