Allow patrolling page creations from Special:RecentChanges
authorMarius Hoch <hoo@online.de>
Wed, 29 May 2013 10:29:17 +0000 (12:29 +0200)
committerMarius Hoch <hoo@online.de>
Wed, 29 May 2013 10:49:59 +0000 (12:49 +0200)
In case we got a page creation which is yet unpatrolled and
recent changes patrolling is enabled, the user probably rather
wants to patrol the whole page (first revision) instead of seeing
a patrollink for the current revision.

Follow up to I1e24733c

Bug: 48928
Change-Id: I9f89f1d44852d4c03a67ac622d5cf4d86453dce3

includes/ChangesList.php

index 796b92a..f2d1533 100644 (file)
@@ -362,10 +362,18 @@ class ChangesList extends ContextSource {
         * @param $watched
         */
        public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) {
-               # If it's a new article, there is no diff link, but if it hasn't been
-               # patrolled yet, we need to give users a way to do so
+               global $wgUseRCPatrol;
+
                $params = array();
 
+               // In case we got a page creation which is yet unpatrolled and
+               // recent changes patrolling is enabled, the user probably rather
+               // wants to patrol the whole page (first revision) instead of seeing
+               // a patrollink for the current revision.
+               if ( $wgUseRCPatrol && $unpatrolled && $rc->getAttribute( 'rc_type' ) == RC_NEW ) {
+                       $params['patrolpage'] = 1;
+               }
+
                $articlelink = Linker::linkKnown(
                        $rc->getTitle(),
                        null,