Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -481,11 +481,12 @@ |
482 | 482 | */ |
483 | 483 | public static function updatePageCache( $article, $parserOutput=NULL ) { |
484 | 484 | global $wgUser, $parserMemc, $wgFlaggedRevsExpire; |
485 | | - // Update the cache... |
486 | | - $article->mTitle->invalidateCache(); |
487 | 485 | // Make sure it is valid |
488 | 486 | if ( is_null($parserOutput) || !$article ) |
489 | 487 | return false; |
| 488 | + // Update the cache... |
| 489 | + $article->mTitle->invalidateCache(); |
| 490 | + |
490 | 491 | $key = 'sv-' . ParserCache::getKey( $article, $wgUser ); |
491 | 492 | // Add cache mark to HTML |
492 | 493 | $now = wfTimestampNow(); |
— | — | @@ -518,7 +519,7 @@ |
519 | 520 | } |
520 | 521 | |
521 | 522 | function extraLinksUpdate( &$article ) { |
522 | | - $fname = 'FlaggedRevs::doIncrementalUpdate'; |
| 523 | + $fname = 'FlaggedRevs::extraLinksUpdate'; |
523 | 524 | wfProfileIn( $fname ); |
524 | 525 | # Check if this page has a stable version |
525 | 526 | $sv = $this->getOverridingPageRev( $article ); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php |
— | — | @@ -628,24 +628,25 @@ |
629 | 629 | return '<p>'.wfMsg("unreviewed-list")."</p><br />\n"; |
630 | 630 | } |
631 | 631 | |
632 | | - function getSQLText( &$dbr, $namespace, $nonquality = false ) { |
| 632 | + function getSQLText( &$dbr, $namespace, $includenonquality = false ) { |
633 | 633 | global $wgContentNamespaces; |
634 | 634 | |
635 | 635 | list( $page, $flaggedrevs ) = $dbr->tableNamesN( 'page', 'flaggedrevs' ); |
636 | 636 | |
637 | 637 | $ns = ($namespace !== null) ? "page_namespace=$namespace" : '1 = 1'; |
638 | | - $where = $nonquality ? '1 = 1' : 'fr_rev_id IS NULL'; |
| 638 | + $where = $includenonquality ? '1 = 1' : 'fr_rev_id IS NULL'; |
| 639 | + $having = $includenonquality ? '(MAX(fr_quality) IS NULL OR MAX(fr_quality) < 1)' : '1 = 1'; |
639 | 640 | $content = array(); |
640 | 641 | foreach( $wgContentNamespaces as $cns ) { |
641 | 642 | $content[] = "page_namespace=$cns"; |
642 | 643 | } |
643 | 644 | $content = implode(' OR ',$content); |
644 | 645 | $sql = |
645 | | - "SELECT page_namespace,page_title,page_len AS size, MAX(fr_quality) as quality, COUNT(*) as num |
| 646 | + "SELECT page_namespace,page_title,page_len AS size |
646 | 647 | FROM $page |
647 | 648 | LEFT JOIN $flaggedrevs ON (fr_namespace = page_namespace AND fr_title = page_title) |
648 | | - WHERE page_is_redirect=0 AND $ns AND ($where) AND ($content) |
649 | | - GROUP BY page_id "; |
| 649 | + WHERE page_is_redirect=0 AND $ns AND ($content) AND ($where) |
| 650 | + GROUP BY page_id HAVING $having "; |
650 | 651 | return $sql; |
651 | 652 | } |
652 | 653 | |
— | — | @@ -661,10 +662,6 @@ |
662 | 663 | function formatResult( $skin, $result ) { |
663 | 664 | global $wgLang; |
664 | 665 | |
665 | | - // If the best revision of the page is quality |
666 | | - // then skip it... |
667 | | - if ( $this->nonquality && $result->quality >= 1 ) |
668 | | - return false; |
669 | 666 | $fname = 'UnreviewedPagesPage::formatResult'; |
670 | 667 | $title = Title::makeTitle( $result->page_namespace, $result->page_title ); |
671 | 668 | $link = $skin->makeKnownLinkObj( $title ); |