r67675 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67674‎ | r67675 | r67676 >
Date:23:05, 8 June 2010
Author:aaron
Status:deferred
Tags:
Comment:
* fixed setViewFlags(); oldRev can be 'false'
* fixed type (false -> null) for stableVersionIsSynced() call
* cleaned up overrideRedirect() to use getMemcValue()
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1684,8 +1684,9 @@
16851685 }
16861686
16871687 public static function overrideRedirect(
1688 - &$title, $request, &$ignoreRedirect, &$target, &$article
 1688+ Title &$title, WebRequest $request, &$ignoreRedirect, &$target, Article &$article
16891689 ) {
 1690+ global $wgMemc, $wgParserCacheExpireTime;
16901691 # Get an instance on the title ($wgTitle)
16911692 if ( !FlaggedRevs::inReviewNamespace( $title ) ) {
16921693 return true;
@@ -1693,12 +1694,11 @@
16941695 if ( $request->getVal( 'stableid' ) ) {
16951696 $ignoreRedirect = true;
16961697 } else {
1697 - global $wgMemc, $wgParserCacheExpireTime;
16981698 # Try the cache...
16991699 $key = wfMemcKey( 'flaggedrevs', 'overrideRedirect', $title->getArticleId() );
1700 - $data = $wgMemc->get( $key );
1701 - if ( is_object( $data ) && $data->time >= $article->getTouched() ) {
1702 - list( $ignoreRedirect, $target ) = $data->value;
 1700+ $tuple = FlaggedRevs::getMemcValue( $wgMemc->get( $key ), $article );
 1701+ if ( is_array( $tuple ) ) {
 1702+ list( $ignoreRedirect, $target ) = $tuple;
17031703 return true;
17041704 }
17051705 $fa = FlaggedArticle::getTitleInstance( $title );
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -545,6 +545,8 @@
546546 $this->article, $text, $srev->getRevId() );
547547 # Update the stable version cache
548548 FlaggedRevs::updatePageCache( $this->article, $wgUser, $parserOut );
 549+ } else {
 550+ $parserOut = null;
549551 }
550552 }
551553 $synced = FlaggedRevs::stableVersionIsSynced( $srev, $this->article, $parserOut, null );
@@ -597,6 +599,7 @@
598600 if ( $redirHtml != '' ) {
599601 $wgOut->addHtml( $redirHtml );
600602 } else {
 603+ // $parserOut will not be null here
601604 $wgOut->addParserOutput( $parserOut );
602605 }
603606 }
@@ -1444,8 +1447,9 @@
14451448
14461449 /**
14471450 * Set $this->isDiffFromStable and $this->isMultiPageDiff fields
 1451+ * Note: $oldRev could be false
14481452 */
1449 - public function setViewFlags( $diff, Revision $oldRev, Revision $newRev ) {
 1453+ public function setViewFlags( $diff, $oldRev, $newRev ) {
14501454 $this->load();
14511455 if ( $newRev && $oldRev ) {
14521456 // Is this a diff between two pages?

Follow-up revisions

RevisionCommit summaryAuthorDate
r67677Updated messages to r67675 /trunk state. Some stuff wasn't merged over time.aaron23:43, 8 June 2010

Status & tagging log