r63447 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63446‎ | r63447 | r63448 >
Date:00:36, 9 March 2010
Author:aaron
Status:ok
Tags:
Comment:
Fixed broken FR_INCLUDES_CURRENT setting (sync bug)
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -565,7 +565,7 @@
566566 global $wgParser;
567567 # Make our hooks trigger (force unstub so setting doesn't get lost)
568568 $wgParser->firstCallInit();
569 - $wgParser->fr_isStable = true;
 569+ $wgParser->fr_isStable = ( FlaggedRevs::inclusionSetting() != FR_INCLUDES_CURRENT );
570570 # Parse with default options
571571 $options = self::makeParserOptions();
572572 $outputText = $wgParser->preprocess( $text, $title, $options, $id );
@@ -590,7 +590,7 @@
591591 $title = $article->getTitle(); // avoid pass-by-reference error
592592 # Make our hooks trigger (force unstub so setting doesn't get lost)
593593 $wgParser->firstCallInit();
594 - $wgParser->fr_isStable = true;
 594+ $wgParser->fr_isStable = ( FlaggedRevs::inclusionSetting() != FR_INCLUDES_CURRENT );
595595 # Don't show section-edit links, they can be old and misleading
596596 $options = self::makeParserOptions();
597597 # Parse the new body, wikitext -> html
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -462,9 +462,6 @@
463463 if ( !$parser || empty( $parser->fr_isStable ) || $title->getNamespace() < 0 ) {
464464 return true;
465465 }
466 - if( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) {
467 - return true; // use the current version as normal
468 - }
469466 $dbr = wfGetDB( DB_SLAVE );
470467 # Check for stable version of template if this feature is enabled.
471468 # Should be in reviewable namespace, this saves unneeded DB checks as
@@ -526,9 +523,6 @@
527524 if ( empty( $parser->fr_isStable ) ) {
528525 return true;
529526 }
530 - if( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) {
531 - return true; // use the current version as normal
532 - }
533527 $file = null;
534528 $isKnownLocal = $isLocalFile = false; // local file on this wiki?
535529 # Normalize NS_MEDIA to NS_FILE
@@ -627,9 +621,6 @@
628622 if ( empty( $ig->mParser->fr_isStable ) || $nt->getNamespace() != NS_FILE ) {
629623 return true;
630624 }
631 - if( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) {
632 - return true; // use the current version as normal
633 - }
634625 $file = null;
635626 $isKnownLocal = $isLocalFile = false; // local file on this wiki?
636627 # Check for stable version of image if this feature is enabled.

Follow-up revisions

RevisionCommit summaryAuthorDate
r63448Merged r63447 from trunkaaron00:39, 9 March 2010

Status & tagging log