From a3a34ebeecb0eac8920c91098e1e360b77422a91 Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Wed, 29 May 2013 12:29:17 +0200 Subject: [PATCH] Allow patrolling page creations from Special:RecentChanges 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 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 796b92ad0a..f2d1533450 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -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, -- 2.20.1