From: Aaron Schulz Date: Sat, 24 Jan 2009 22:50:28 +0000 (+0000) Subject: (bug 17104) Remove [Mark as patrolled] link for already patrolled revisions X-Git-Tag: 1.31.0-rc.0~43265 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=ebddcaca6a065b57385dbfe84ea3b6024d45cfff;p=lhc%2Fweb%2Fwiklou.git (bug 17104) Remove [Mark as patrolled] link for already patrolled revisions --- diff --git a/includes/Article.php b/includes/Article.php index 6b2c497f3b..f37538d970 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -974,9 +974,15 @@ class Article { # Only diffs and new page links from RC give rcid params, so if # we are just viewing the page normally with no rcid, try to find it. # This is more convenient for users. - if( empty($rcid) && $this->mTitle->exists() && $this->mTitle->userCan('patrol') ) { - $firstRev = $this->mTitle->getFirstRevision(); - $rcid = $firstRev ? $firstRev->isUnpatrolled() : 0; + if( $this->mTitle->exists() && $this->mTitle->userCan('patrol') ) { + if( empty($rcid) ) { + $firstRev = $this->mTitle->getFirstRevision(); + $rcid = $firstRev ? $firstRev->isUnpatrolled() : 0; + } else { + $rc = RecentChange::newFromId( $rcid ); + // Already patrolled? + $rcid = is_object($rc) && !$rc->getAttribute('rc_patrolled') ? $rcid : 0; + } } # If we have been passed an &rcid= parameter, we want to give the user a # chance to mark this new article as patrolled. diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 05e69ffbab..a0848d064a 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -168,6 +168,9 @@ CONTROL; // If we've been given an explicit change identifier, use it; saves time if( $this->mRcidMarkPatrolled ) { $rcid = $this->mRcidMarkPatrolled; + $rc = RecentChange::newFromId( $rcid ); + // Already patrolled? + $rcid = is_object($rc) && !$rc->getAttribute('rc_patrolled') ? $rcid : 0; } else { // Look for an unpatrolled change corresponding to this diff $db = wfGetDB( DB_SLAVE );