Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -33,9 +33,9 @@ |
34 | 34 | # B/C, $levels is just an integer (minQL) |
35 | 35 | } else { |
36 | 36 | global $wgFlaggedRevPristine, $wgFlaggedRevValues; |
37 | | - $minQL = $levels; |
38 | | - $minPL = isset($wgFlaggedRevPristine) ? $wgFlaggedRevPristine : $wgFlaggedRevValues+1; |
39 | 37 | $ratingLevels = isset($wgFlaggedRevValues) ? $wgFlaggedRevValues : 1; |
| 38 | + $minQL = $levels; // an integer |
| 39 | + $minPL = isset($wgFlaggedRevPristine) ? $wgFlaggedRevPristine : $ratingLevels+1; |
40 | 40 | } |
41 | 41 | # Set FlaggedRevs tags |
42 | 42 | self::$dimensions[$tag] = array(); |
— | — | @@ -67,7 +67,6 @@ |
68 | 68 | self::$feedbackTags[$tag][$i] = "feedback-{$tag}-{$i}"; |
69 | 69 | } |
70 | 70 | } |
71 | | - |
72 | 71 | self::$loaded = true; |
73 | 72 | } |
74 | 73 | |
— | — | @@ -538,13 +537,13 @@ |
539 | 538 | */ |
540 | 539 | public static function stableVersionIsSynced( $srev, $article, $stableOutput=null, $currentOutput=null ) { |
541 | 540 | global $wgMemc, $wgEnableParserCache; |
542 | | - # Must be the same revision |
543 | | - if( $srev->getRevId() != $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE) ) { |
| 541 | + # Must be the same revision as the current |
| 542 | + if( $srev->getRevId() < $article->getTitle()->getLatestRevID() ) { |
544 | 543 | return false; |
545 | 544 | } |
546 | 545 | # Must have same file |
547 | 546 | if( $article instanceof ImagePage && $article->getFile() ) { |
548 | | - if( $srev->getFileTimestamp() != $article->getFile()->getTimestamp() ) { |
| 547 | + if( $srev->getFileTimestamp() < $article->getFile()->getTimestamp() ) { |
549 | 548 | return false; |
550 | 549 | } |
551 | 550 | } |
— | — | @@ -560,7 +559,7 @@ |
561 | 560 | if( is_null($stableOutput) || !isset($stableOutput->fr_newestTemplateID) ) { |
562 | 561 | # Get parsed stable version |
563 | 562 | $stableOutput = self::getPageCache( $article ); |
564 | | - if( $stableOutput==false ) { |
| 563 | + if( $stableOutput == false ) { |
565 | 564 | $text = $srev->getRevText(); |
566 | 565 | $stableOutput = self::parseStableText( $article, $text, $srev->getRevId() ); |
567 | 566 | # Update the stable version cache |
— | — | @@ -571,10 +570,21 @@ |
572 | 571 | global $wgUser, $wgParser; |
573 | 572 | # Get parsed current version |
574 | 573 | $parserCache = ParserCache::singleton(); |
575 | | - $currentOutput = $parserCache->get( $article, $wgUser ); |
| 574 | + $currentOutput = false; |
576 | 575 | # If $text is set, then the stableOutput is new. In that case, |
577 | 576 | # the current must also be new to avoid sync goofs. |
578 | | - if( $currentOutput==false || isset($text) ) { |
| 577 | + if( !isset($text) ) { |
| 578 | + # Try anon user cache first... |
| 579 | + if( $wgUser->getId() ) { |
| 580 | + $anon = User::newFromId( 0 ); |
| 581 | + $currentOutput = $parserCache->get( $article, $anon ); |
| 582 | + } |
| 583 | + # Cache for this user... |
| 584 | + if( $currentOutput == false ) |
| 585 | + $currentOutput = $parserCache->get( $article, $wgUser ); |
| 586 | + } |
| 587 | + # Regenerate the parser output as needed... |
| 588 | + if( $currentOutput == false ) { |
579 | 589 | $rev = Revision::newFromTitle( $article->getTitle() ); |
580 | 590 | $text = $rev ? $rev->getText() : false; |
581 | 591 | $title = $article->getTitle(); |