From: Kunal Mehta Date: Mon, 15 Sep 2014 02:31:38 +0000 (-0700) Subject: MovePage::move(): Return a Status object X-Git-Tag: 1.31.0-rc.0~13993^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=52f1d0d7b3ab51efe69bee831965fade9903777c;p=lhc%2Fweb%2Fwiklou.git MovePage::move(): Return a Status object Change-Id: I17e6f6d36ae2052bd09d21eb94546d94bda9bce9 --- diff --git a/includes/MovePage.php b/includes/MovePage.php index 922fe3554a..fdece8d5be 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -46,7 +46,7 @@ class MovePage { * @param User $user * @param string $reason * @param bool $createRedirect - * @return array|bool True on success, getUserPermissionsErrors()-like array on failure + * @return Status */ public function move( User $user, $reason, $createRedirect ) { global $wgCategoryCollation; @@ -59,7 +59,7 @@ class MovePage { if ( $file->exists() ) { $status = $file->move( $this->newTitle ); if ( !$status->isOk() ) { - return $status->getErrorsArray(); + return $status; } } // Clear RepoGroup process cache @@ -189,7 +189,7 @@ class MovePage { $dbw->commit( __METHOD__ ); wfRunHooks( 'TitleMoveComplete', array( &$this->oldTitle, &$this->newTitle, &$user, $pageid, $redirid, $reason ) ); - return true; + return Status::newGood(); } diff --git a/includes/Title.php b/includes/Title.php index a8d1bb885f..8727b74fe0 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3765,7 +3765,12 @@ class Title { wfRunHooks( 'TitleMove', array( $this, $nt, $wgUser ) ); $mp = new MovePage( $this, $nt ); - return $mp->move( $wgUser, $reason, $createRedirect ); + $status = $mp->move( $wgUser, $reason, $createRedirect ); + if ( $status->isOK() ) { + return true; + } else { + return $status->getErrorsArray(); + } } /**