r41567 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41566‎ | r41567 | r41568 >
Date:21:19, 2 October 2008
Author:aaron
Status:old
Tags:
Comment:
Ignore commons image sync status in main UI (bug 15748)
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
@@ -530,7 +530,9 @@
531531 # Get parsed current version
532532 $parserCache = ParserCache::singleton();
533533 $currentOutput = $parserCache->get( $article, $wgUser );
534 - if( $currentOutput==false ) {
 534+ # If $text is set, then the stableOutput is new. In that case,
 535+ # the current must also be new to avoid sync goofs.
 536+ if( $currentOutput==false || isset($text) ) {
535537 $text = $article->getContent();
536538 $title = $article->getTitle();
537539 $options = self::makeParserOptions();
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -365,6 +365,7 @@
366366 if( empty($parser->fr_isStable) ) {
367367 return true;
368368 }
 369+ $file = null;
369370 $dbr = wfGetDB( DB_SLAVE );
370371 # Normalize NS_MEDIA to NS_IMAGE
371372 $title = $nt->getNamespace() == NS_IMAGE ? $nt : Title::makeTitle( NS_IMAGE, $nt->getDBKey() );
@@ -421,7 +422,9 @@
422423 # Add image metadata to parser output
423424 $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()] = array();
424425 $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()][$time] = $sha1;
425 - if( $time > $parser->mOutput->fr_newestImageTime ) {
 426+ # Bug 15748, be lax about commons image sync status
 427+ $file = $file ? $file : wfFindFile( $title, $time ); # FIXME: would be nice not to double fetch!
 428+ if( $file && $file->isLocal() && $time > $parser->mOutput->fr_newestImageTime ) {
426429 $parser->mOutput->fr_newestImageTime = $time;
427430 }
428431 return true;
@@ -435,6 +438,7 @@
436439 if( empty($ig->mParser->fr_isStable) || $nt->getNamespace() != NS_IMAGE ) {
437440 return true;
438441 }
 442+ $file = null;
439443 $dbr = wfGetDB( DB_SLAVE );
440444 # Check for stable version of image if this feature is enabled.
441445 # Should be in reviewable namespace, this saves unneeded DB checks as
@@ -489,7 +493,9 @@
490494 # Add image metadata to parser output
491495 $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()] = array();
492496 $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()][$time] = $sha1;
493 - if( $time > $ig->mParser->mOutput->fr_newestImageTime ) {
 497+ # Bug 15748, be lax about commons image sync status
 498+ $file = $file ? $file : wfFindFile( $title, $time ); # FIXME: would be nice not to double fetch!
 499+ if( $file && $file->isLocal() && $time > $ig->mParser->mOutput->fr_newestImageTime ) {
494500 $ig->mParser->mOutput->fr_newestImageTime = $time;
495501 }
496502 return true;
@@ -524,7 +530,8 @@
525531 $file = wfFindFile( Title::makeTitle( NS_IMAGE, $filename ) );
526532 $parser->mOutput->fr_ImageSHA1Keys[$filename] = array();
527533 if( $file ) {
528 - if( $file->getTimestamp() > $maxTimestamp ) {
 534+ # Bug 15748, be lax about commons image sync status
 535+ if( $file->isLocal() && $file->getTimestamp() > $maxTimestamp ) {
529536 $maxTimestamp = $file->getTimestamp();
530537 }
531538 $parser->mOutput->fr_ImageSHA1Keys[$filename][$file->getTimestamp()] = $file->getSha1();

Status & tagging log