r45183 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45182‎ | r45183 | r45184 >
Date:13:33, 30 December 2008
Author:aaron
Status:deferred
Tags:
Comment:
Avoid history item duplication on lists
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1212,7 +1212,9 @@
12131213 public static function addToFileHistQuery( $file, &$tables, &$fields, &$conds, &$opts, &$join_conds ) {
12141214 if( $file->isLocal() ) {
12151215 $tables[] = 'flaggedrevs';
1216 - $fields[] = 'fr_quality';
 1216+ $fields[] = 'MAX(fr_quality) AS fr_quality';
 1217+ # Avoid duplicate rows due to multiple revs with the same sha-1 key
 1218+ $opts['GROUP BY'] = 'oi_name,oi_timestamp';
12171219 $join_conds['flaggedrevs'] = array( 'LEFT JOIN', 'oi_sha1 = fr_img_sha1 AND oi_timestamp = fr_img_timestamp' );
12181220 }
12191221 return true;

Status & tagging log