Mark rollbacking revision as patrolled
authorMatěj Suchánek <matejsuchanek97@gmail.com>
Fri, 29 Jun 2018 07:14:15 +0000 (07:14 +0000)
committerMatěj Suchánek <matejsuchanek97@gmail.com>
Fri, 29 Jun 2018 07:49:18 +0000 (07:49 +0000)
I just copy & pasted lines 1833-1838.

Bug: T198449
Change-Id: I5d356b074e048a2325a64bfe2c1e652c640c560f

includes/page/WikiPage.php

index 18ecff4..ecb113b 100644 (file)
@@ -2962,6 +2962,13 @@ class WikiPage implements Page, IDBAccessObject {
                $updater->setUndidRevisionId( $current->getId() );
                $updater->addTags( $tags );
 
+               // TODO: this logic should not be in the storage layer, it's here for compatibility
+               // with 1.31 behavior. Applying the 'autopatrol' right should be done in the same
+               // place the 'bot' right is handled, which is currently in EditPage::attemptSave.
+               if ( $wgUseRCPatrol && $this->getTitle()->userCan( 'autopatrol', $guser ) ) {
+                       $updater->setRcPatrolStatus( RecentChange::PRC_AUTOPATROLLED );
+               }
+
                // Actually store the rollback
                $rev = $updater->saveRevision(
                        CommentStoreComment::newUnsavedComment( $summary ),