r46495 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46494‎ | r46495 | r46496 >
Date:23:37, 28 January 2009
Author:werdna
Status:resolved (Comments)
Tags:
Comment:
Fix patrolling checks, which are using the expensive version of userCan, and therefore causing queries to be made cross-cluster on every single pageview.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -996,7 +996,7 @@
997997 # Only diffs and new page links from RC give rcid params, so if
998998 # we are just viewing the page normally with no rcid, try to find it.
999999 # This is more convenient for users.
1000 - if( $this->mTitle->exists() && $this->mTitle->userCan('patrol') ) {
 1000+ if( $this->mTitle->exists() && $this->mTitle->userCan('patrol', false) ) {
10011001 if( empty($rcid) ) {
10021002 $firstRev = $this->mTitle->getFirstRevision();
10031003 $rcid = $firstRev ? $firstRev->isUnpatrolled() : 0;
@@ -1008,7 +1008,7 @@
10091009 }
10101010 # If we have been passed an &rcid= parameter, we want to give the user a
10111011 # chance to mark this new article as patrolled.
1012 - if( !empty($rcid) && $this->mTitle->exists() && $this->mTitle->userCan('patrol') ) {
 1012+ if( !empty($rcid) && $this->mTitle->exists() && $this->mTitle->userCan('patrol', false) ) {
10131013 $wgOut->addHTML(
10141014 "<div class='patrollink'>" .
10151015 wfMsgHtml( 'markaspatrolledlink',

Comments

#Comment by Werdna (talk | contribs)   23:12, 11 February 2009

Weird boolean param changed to real version of the function in r46537.

Status & tagging log