X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FMergeHistory.php;h=1a950c5f5e1f74262aa8e0fe0b730c2c324acf87;hp=0914a9b7d8deb2f24bf413ce1a8a552bf18cb2dd;hb=9c7f6734c397a954b8eaa5ec73876f2b4bf92afb;hpb=4077b57759756ecd0d25427ec9598feb28a28ac1 diff --git a/includes/MergeHistory.php b/includes/MergeHistory.php index 0914a9b7d8..1a950c5f5e 100644 --- a/includes/MergeHistory.php +++ b/includes/MergeHistory.php @@ -32,7 +32,7 @@ use Wikimedia\Rdbms\IDatabase; */ class MergeHistory { - /** @const int Maximum number of revisions that can be merged at once */ + /** Maximum number of revisions that can be merged at once */ const REVISION_LIMIT = 5000; /** @var Title Page from which history will be merged */ @@ -178,7 +178,8 @@ class MergeHistory { } // Check mergehistory permission - if ( !$user->isAllowed( 'mergehistory' ) ) { + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); + if ( !$permissionManager->userHasRight( $user, 'mergehistory' ) ) { // User doesn't have the right to merge histories $status->fatal( 'mergehistory-fail-permission' ); } @@ -272,6 +273,18 @@ class MergeHistory { return $status; } + // Update denormalized revactor_page too + $this->dbw->update( + 'revision_actor_temp', + [ 'revactor_page' => $this->dest->getArticleID() ], + [ + 'revactor_page' => $this->source->getArticleID(), + // Slightly hacky, but should work given the values assigned in this class + str_replace( 'rev_timestamp', 'revactor_timestamp', $this->timeWhere ) + ], + __METHOD__ + ); + // Make the source page a redirect if no revisions are left $haveRevisions = $this->dbw->lockForUpdate( 'revision',