r84642 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84641‎ | r84642 | r84643 >
Date:22:13, 23 March 2011
Author:laner
Status:ok
Tags:
Comment:
Removing pass by reference, and making the $error argument for doDeleteArticle a reference. Follow up for r84638.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/api/ApiDelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -3052,7 +3052,7 @@
30533053 $id = $this->mTitle->getArticleID( Title::GAID_FOR_UPDATE );
30543054
30553055 $error = '';
3056 - if ( $this->doDeleteArticle( $reason, $suppress, $id, &$error ) ) {
 3056+ if ( $this->doDeleteArticle( $reason, $suppress, $id, $error ) ) {
30573057 $deleted = $this->mTitle->getPrefixedText();
30583058
30593059 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
@@ -3099,7 +3099,7 @@
31003100 * @param $commit boolean defaults to true, triggers transaction end
31013101 * @return boolean true if successful
31023102 */
3103 - public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true, $error='' ) {
 3103+ public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true, &$error='' ) {
31043104 global $wgDeferredUpdateList, $wgUseTrackbacks;
31053105
31063106 wfDebug( __METHOD__ . "\n" );
Index: trunk/phase3/includes/api/ApiDelete.php
@@ -147,7 +147,7 @@
148148
149149 $error = '';
150150 // Luckily, Article.php provides a reusable delete function that does the hard work for us
151 - if ( $article->doDeleteArticle( $reason, false, 0, true, &$error ) ) {
 151+ if ( $article->doDeleteArticle( $reason, false, 0, true, $error ) ) {
152152 return array();
153153 } else {
154154 return array( array( 'cannotdelete', $article->mTitle->getPrefixedText() ) );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84638Moving deletion hooks into doArticleDelete so that other code can sanely dele...laner21:54, 23 March 2011

Status & tagging log