r34611 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34610‎ | r34611 | r34612 >
Date:13:14, 11 May 2008
Author:aaron
Status:old
Tags:
Comment:
* Fix constant
* Pass page_id to getRevisionTags()
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -858,10 +858,11 @@
859859 * @param int $rev_id
860860 * @return Array
861861 */
862 - public static function getRevisionTags( $rev_id ) {
 862+ public static function getRevisionTags( $article, $rev_id ) {
863863 $dbr = wfGetDB( DB_SLAVE );
864864 $tags = $dbr->selectField( 'flaggedrevs', 'fr_tags',
865 - array('fr_rev_id' => $rev_id ),
 865+ array( 'fr_rev_id' => $rev_id,
 866+ 'fr_page_id' => $article->getId() ),
866867 __METHOD__ );
867868 if( !$tags )
868869 return false;
@@ -1765,7 +1766,7 @@
17661767 return true;
17671768 # GetTitle() for revisions uses slaves and wants page_id,rev_id to
17681769 # match...this is bad if we *just* added it.
1769 - $title = $rev->getTitle() ? $rev->getTitle() : Title::newFromID( $rev->getPage(), FOR_UPDATE );
 1770+ $title = $rev->getTitle() ? $rev->getTitle() : Title::newFromID( $rev->getPage(), GAID_FOR_UPDATE );
17701771 # Must be in reviewable namespace
17711772 if( !$title || !self::isPageReviewable( $title ) ) {
17721773 return true;
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -969,7 +969,7 @@
970970 if( isset($this->flags[$rev_id]) && $this->flags[$rev_id] )
971971 return $this->flags[$rev_id];
972972 # Get the flags
973 - $flags = FlaggedRevs::getRevisionTags( $rev_id );
 973+ $flags = FlaggedRevs::getRevisionTags( $this->getTitle(), $rev_id );
974974 # Try to cache results
975975 $this->flags[$rev_id] = $flags;
976976
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php
@@ -83,7 +83,7 @@
8484 $this->notes = ( FlaggedRevs::allowComments() && $wgUser->isAllowed('validate') ) ?
8585 $wgRequest->getText('wpNotes') : '';
8686 # Get the revision's current flags, if any
87 - $this->oflags = FlaggedRevs::getRevisionTags( $this->oldid );
 87+ $this->oflags = FlaggedRevs::getRevisionTags( $this->page, $this->oldid );
8888 # Get our accuracy/quality dimensions
8989 $this->dims = array();
9090 $this->unapprovedTags = 0;

Status & tagging log