Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -639,7 +639,9 @@ |
640 | 640 | $row = $db->selectRow( array('flaggedrevs','revision'), |
641 | 641 | $columns, |
642 | 642 | array( 'fr_page_id' => $title->getArticleID(), |
643 | | - 'fr_rev_id' => $rev_id, 'fr_rev_id = rev_id', |
| 643 | + 'fr_rev_id' => $rev_id, |
| 644 | + 'rev_id = fr_rev_id', |
| 645 | + 'rev_page = fr_page_id', |
644 | 646 | 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), |
645 | 647 | __METHOD__ ); |
646 | 648 | # Sorted from highest to lowest, so just take the first one if any |
— | — | @@ -723,7 +725,8 @@ |
724 | 726 | $columns, |
725 | 727 | array( 'fr_page_id' => $title->getArticleID(), |
726 | 728 | 'fr_quality >= 1', |
727 | | - 'fr_rev_id = rev_id', |
| 729 | + 'rev_id = fr_rev_id', |
| 730 | + 'rev_page = fr_page_id', |
728 | 731 | 'rev_deleted & '.Revision::DELETED_TEXT => 0), |
729 | 732 | __METHOD__, |
730 | 733 | array( 'ORDER BY' => 'fr_rev_id DESC') ); |
— | — | @@ -734,7 +737,8 @@ |
735 | 738 | $row = $dbw->selectRow( array('flaggedrevs','revision'), |
736 | 739 | $columns, |
737 | 740 | array( 'fr_page_id' => $title->getArticleID(), |
738 | | - 'fr_rev_id = rev_id', |
| 741 | + 'rev_id = fr_rev_id', |
| 742 | + 'rev_page = fr_page_id', |
739 | 743 | 'rev_deleted & '.Revision::DELETED_TEXT => 0), |
740 | 744 | __METHOD__, |
741 | 745 | array( 'ORDER BY' => 'fr_rev_id DESC' ) ); |
— | — | @@ -765,7 +769,7 @@ |
766 | 770 | |
767 | 771 | if( !$count ) { |
768 | 772 | $dbr = wfGetDB( DB_SLAVE ); |
769 | | - $count = $dbr->selectField('revision', 'COUNT(*)', |
| 773 | + $count = $dbr->selectField( 'revision', 'COUNT(*)', |
770 | 774 | array('rev_page' => $article->getId(), "rev_id > " . intval($from_rev) ), |
771 | 775 | __METHOD__ ); |
772 | 776 | # Save to cache |
— | — | @@ -1237,7 +1241,8 @@ |
1238 | 1242 | $maxQuality = $dbw->selectField( array('flaggedrevs','revision'), |
1239 | 1243 | 'fr_quality', |
1240 | 1244 | array( 'fr_page_id' => $article->getTitle()->getArticleID(), |
1241 | | - 'fr_rev_id = rev_id', |
| 1245 | + 'rev_id = fr_rev_id', |
| 1246 | + 'rev_page = fr_page_id', |
1242 | 1247 | 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), |
1243 | 1248 | __METHOD__, |
1244 | 1249 | array( 'ORDER BY' => 'fr_quality DESC', 'LIMIT' => 1 ) ); |