r55395 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55394‎ | r55395 | r55396 >
Date:21:31, 20 August 2009
Author:brion
Status:ok (Comments)
Tags:todo 
Comment:
bug 20327 Error in FlaggedRevs.hooks.php after r55168's restructuring of history page classes
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/phase3/includes/HistoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HistoryPage.php
@@ -270,6 +270,11 @@
271271 $this->tagFilter = $tagFilter;
272272 $this->getDateCond( $year, $month );
273273 }
 274+
 275+ // For hook compatibility...
 276+ function getArticle() {
 277+ return $this->historyPage->getArticle();
 278+ }
274279
275280 function getQueryInfo() {
276281 $queryInfo = array(
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1457,7 +1457,14 @@
14581458 }
14591459
14601460 public static function addToHistQuery( $pager, &$queryInfo ) {
1461 - $flaggedArticle = FlaggedArticle::getTitleInstance( $pager->mPageHistory->getTitle() );
 1461+ if( isset( $pager->mPageHistory ) ) {
 1462+ // 1.15 or before
 1463+ $historyPage = $pager->mPageHistory;
 1464+ } else {
 1465+ // 1.16 after r55168
 1466+ $historyPage = $pager->historyPage;
 1467+ }
 1468+ $flaggedArticle = FlaggedArticle::getTitleInstance( $historyPage->getTitle() );
14621469 # Non-content pages cannot be validated. Stable version must exist.
14631470 if( $flaggedArticle->isReviewable() && $flaggedArticle->getStableRev() ) {
14641471 $queryInfo['tables'][] = 'flaggedrevs';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55168* Renamed PageHistory to HistoryPage. Brion gave me permission to do this a c...tstarling05:09, 17 August 2009

Comments

#Comment by Aaron Schulz (talk | contribs)   22:58, 20 August 2009

Hmm, HistoryPager should just have a proper title accessor...this code is ugly. Plus we have extension branches for b/c anyway.

#Comment by Brion VIBBER (talk | contribs)   17:37, 9 September 2009

Adding a todo marker to remind us to prettify it. :)

Status & tagging log