r47868 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47867‎ | r47868 | r47869 >
Date:17:25, 27 February 2009
Author:aaron
Status:ok
Tags:
Comment:
* Don't add on to RC queries when not needed
* Fixed comment
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -1078,7 +1078,7 @@
10791079 __METHOD__,
10801080 array( 'ORDER BY' => 'rev_timestamp DESC' )
10811081 );
1082 - // Find average, median, deviation...
 1082+ // Find average, median...
10831083 $res = $dbr->select( array( 'revision', 'reader_feedback' ),
10841084 array( 'rfb_ratings' ),
10851085 array( 'rev_page' => $page->getArticleId(),
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1372,15 +1372,21 @@
13731373 }
13741374
13751375 public static function addToRCQuery( &$conds, &$tables, &$join_conds, $opts ) {
1376 - $tables[] = 'flaggedpages';
1377 - $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' );
 1376+ global $wgUser;
 1377+ if( $wgUser->isAllowed('review') ) {
 1378+ $tables[] = 'flaggedpages';
 1379+ $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' );
 1380+ }
13781381 return true;
13791382 }
13801383
13811384 public static function addToWatchlistQuery( &$conds, &$tables, &$join_conds, &$fields ) {
1382 - $tables[] = 'flaggedpages';
1383 - $fields[] = 'fp_stable';
1384 - $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' );
 1385+ global $wgUser;
 1386+ if( $wgUser->isAllowed('review') ) {
 1387+ $tables[] = 'flaggedpages';
 1388+ $fields[] = 'fp_stable';
 1389+ $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' );
 1390+ }
13851391 return true;
13861392 }
13871393

Status & tagging log