r87719 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87718‎ | r87719 | r87720 >
Date:14:52, 9 May 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
ArticleFeedback: Fix for r87522: SpecialPageFactory doesn't exist in 1.17wmf1. Instead, call the function statically.
Modified paths:
  • /trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/populateAFStatistics.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php
@@ -321,7 +321,7 @@
322322 * @param object Database result
323323 * @return array
324324 */
325 - public function buildHighsAndLows( $result ) {
 325+ public static function buildHighsAndLows( $result ) {
326326 $highs_lows = array();
327327 foreach ( $result as $row ) {
328328 $highs_lows[] = array(
Index: trunk/extensions/ArticleFeedback/populateAFStatistics.php
@@ -170,8 +170,8 @@
171171 array()
172172 );
173173 // grab the article feedback special page so we can reuse the data structure building code
174 - $sp = SpecialPageFactory::getPage( 'ArticleFeedback' );
175 - $highs_lows = $sp->buildHighsAndLows( $result );
 174+ // FIXME this logic should not be in the special page class
 175+ $highs_lows = SpecialArticleFeedback::buildHighsAndLows( $result );
176176 // stash the data structure in the cache
177177 $wgMemc->set( $key, $highs_lows, 86400 );
178178 $this->output( "Done\n" );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87522Followup r87402, r87381, r87379...awjrichards00:14, 6 May 2011

Comments

#Comment by Awjrichards (talk | contribs)   15:46, 9 May 2011

Thanks for fixing this, Roan - what is the problem with having the logic in the special page class? I wanted to keep the logic in one place rather than have it in both the maint script as well as the special page.

Status & tagging log