r104776 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104775‎ | r104776 | r104777 >
Date:23:09, 30 November 2011
Author:yaron
Status:deferred
Tags:
Comment:
Fixes for MW 1.19
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php
@@ -368,9 +368,13 @@
369369 * of for every row.
370370 */
371371 static function storeApprovedRevisionForHistoryPage( &$article ) {
 372+ // A bug in some versions of MW 1.19 causes $article to be null.
 373+ if ( is_null( $article ) ) {
 374+ return true;
 375+ }
372376 // this will be null if there's no ID
373377 $approvedRevID = ApprovedRevs::getApprovedRevID( $article->getTitle() );
374 - $article->approvedRevID = $approvedRevID;
 378+ $article->getTitle()->approvedRevID = $approvedRevID;
375379 // also load extension messages, while we're at it
376380 ApprovedRevs::loadMessages();
377381 return true;
@@ -392,7 +396,7 @@
393397 $article = $historyPage->getArticle();
394398 // use the rev ID field in the $article object, which was
395399 // stored earlier
396 - $approvedRevID = $article->approvedRevID;
 400+ $approvedRevID = $title->approvedRevID;
397401 if ( $row->rev_id == $approvedRevID ) {
398402 $s .= '★ ';
399403 }

Status & tagging log