- $success = $fromTitle->moveSubpages( $toTitle, true, $reason, !$noredirect, $changeTags );
- if ( isset( $success[0] ) ) {
- $status = $this->errorArrayToStatus( $success );
- return [ 'errors' => $this->getErrorFormatter()->arrayFromStatus( $status ) ];
+ $mp = new MovePage( $fromTitle, $toTitle );
+ $result =
+ $mp->moveSubpagesIfAllowed( $this->getUser(), $reason, !$noredirect, $changeTags );
+ if ( !$result->isOk() ) {
+ // This means the whole thing failed
+ return [ 'errors' => $this->getErrorFormatter()->arrayFromStatus( $result ) ];