* @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;
if ( $file->exists() ) {
$status = $file->move( $this->newTitle );
if ( !$status->isOk() ) {
- return $status->getErrorsArray();
+ return $status;
}
}
// Clear RepoGroup process cache
$dbw->commit( __METHOD__ );
wfRunHooks( 'TitleMoveComplete', array( &$this->oldTitle, &$this->newTitle, &$user, $pageid, $redirid, $reason ) );
- return true;
+ return Status::newGood();
}
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();
+ }
}
/**