r92871 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92870‎ | r92871 | r92872 >
Date:18:18, 22 July 2011
Author:werdna
Status:ok
Tags:
Comment:
ArticleFeedback: reverse the sort order of highs so the best appear first
Modified paths:
  • /trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php
@@ -362,7 +362,7 @@
363363 * everyone feels warm and fuzzy about having more 'highs', as
364364 * it were...
365365 *
366 - * @param array Pre-orderd from lowest to highest
 366+ * @param array Pre-orderd from highest to lowest
367367 * @return array Containing the... highest rated article data
368368 */
369369 protected function getDailyHighs( $highs_lows ) {
@@ -372,7 +372,10 @@
373373 } else {
374374 $num_highs = $num_ratings / 2;
375375 }
376 - return array_slice( $highs_lows, -$num_highs, $num_highs );
 376+ $highs = array_slice( $highs_lows, -$num_highs, $num_highs );
 377+
 378+ // Sort descending
 379+ return array_reverse( $highs );
377380 }
378381
379382 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r947921.17wmf1: MFT r92871 (ArticleFeedback dashboard sort order fix)catrope19:06, 17 August 2011

Status & tagging log