X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMovePage.php;h=634e7affe2e34aa909e2d32101a26c046d3a3e5d;hb=278227608808c25242c87a7092da5fb9adc50cde;hp=e6faacef47ab7840f9a1f45e838be5026e65f00f;hpb=4334e1cc02b9749e92c514bd2aa46b347010f913;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MovePage.php b/includes/MovePage.php index e6faacef47..634e7affe2 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -25,7 +25,7 @@ use MediaWiki\Page\MovePageFactory; use MediaWiki\Permissions\PermissionManager; use MediaWiki\Revision\SlotRecord; use Wikimedia\Rdbms\IDatabase; -use Wikimedia\Rdbms\LoadBalancer; +use Wikimedia\Rdbms\ILoadBalancer; /** * Handles the backend logic of moving a page from one title @@ -51,7 +51,7 @@ class MovePage { protected $options; /** - * @var LoadBalancer + * @var ILoadBalancer */ protected $loadBalancer; @@ -61,7 +61,7 @@ class MovePage { protected $nsInfo; /** - * @var WatchedItemStore + * @var WatchedItemStoreInterface */ protected $watchedItems; @@ -81,7 +81,7 @@ class MovePage { * @param Title $oldTitle * @param Title $newTitle * @param ServiceOptions|null $options - * @param LoadBalancer|null $loadBalancer + * @param ILoadBalancer|null $loadBalancer * @param NamespaceInfo|null $nsInfo * @param WatchedItemStore|null $watchedItems * @param PermissionManager|null $permMgr @@ -90,9 +90,9 @@ class MovePage { Title $oldTitle, Title $newTitle, ServiceOptions $options = null, - LoadBalancer $loadBalancer = null, + ILoadBalancer $loadBalancer = null, NamespaceInfo $nsInfo = null, - WatchedItemStore $watchedItems = null, + WatchedItemStoreInterface $watchedItems = null, PermissionManager $permMgr = null, RepoGroup $repoGroup = null ) { @@ -446,7 +446,7 @@ class MovePage { $status = Status::newFatal( 'movepage-max-pages', $wgMaximumMovedPages ); $perTitleStatus[$oldSubpage->getPrefixedText()] = $status; $topStatus->merge( $status ); - $topStatus->setOk( true ); + $topStatus->setOK( true ); break; } @@ -473,13 +473,14 @@ class MovePage { $mp = new MovePage( $oldSubpage, $newSubpage ); $method = $checkPermissions ? 'moveIfAllowed' : 'move'; + /** @var Status $status */ $status = $mp->$method( $user, $reason, $createRedirect, $changeTags ); if ( $status->isOK() ) { $status->setResult( true, $newSubpage->getPrefixedText() ); } $perTitleStatus[$oldSubpage->getPrefixedText()] = $status; $topStatus->merge( $status ); - $topStatus->setOk( true ); + $topStatus->setOK( true ); } $topStatus->value = $perTitleStatus; @@ -508,7 +509,7 @@ class MovePage { Hooks::run( 'TitleMoveStarting', [ $this->oldTitle, $this->newTitle, $user ] ); - $pageid = $this->oldTitle->getArticleID( Title::GAID_FOR_UPDATE ); + $pageid = $this->oldTitle->getArticleID( Title::READ_LATEST ); $protected = $this->oldTitle->isProtected(); // Do the actual move; if this fails, it will throw an MWException(!) @@ -598,7 +599,7 @@ class MovePage { '4::oldtitle' => $this->oldTitle->getPrefixedText(), ] ); $logEntry->setRelations( [ 'pr_id' => $logRelationsValues ] ); - $logEntry->setTags( $changeTags ); + $logEntry->addTags( $changeTags ); $logId = $logEntry->insert(); $logEntry->publish( $logId ); } @@ -895,7 +896,7 @@ class MovePage { # Log the move $logid = $logEntry->insert(); - $logEntry->setTags( $changeTags ); + $logEntry->addTags( $changeTags ); $logEntry->publish( $logid ); return $nullRevision;