From: Roan Kattouw Date: Thu, 28 Feb 2008 21:41:06 +0000 (+0000) Subject: (bug 12575) Prevent duplicate patrol log entries from being created X-Git-Tag: 1.31.0-rc.0~49307 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=e1cf76726e66249124ac8e984deded28c5ba4963;p=lhc%2Fweb%2Fwiklou.git (bug 12575) Prevent duplicate patrol log entries from being created --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3d3123b6ed..552eefa3fe 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -57,6 +57,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN 'opensearch-desc' message. * (bug 13135) Special:Userrights now passes IDs through form submission to allow functionality on not-quite-right usernames +* (bug 12575) Prevent duplicate patrol log entries from being created === API changes in 1.13 === diff --git a/includes/Article.php b/includes/Article.php index 68e561ab06..cc0e2c5d9d 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1531,7 +1531,7 @@ class Article { return; } - if ( !$wgUseRCPatrol && $rc->mAttribs['rc_type'] != RC_NEW) { + if ( !$wgUseRCPatrol && $rc->getAttribute( 'rc_type' ) != RC_NEW) { // Only new pages can be patrolled if the general patrolling is off....??? // @fixme -- is this necessary? Shouldn't we only bother controlling the // front end here? @@ -1554,7 +1554,7 @@ class Article { } #It would be nice to see where the user had actually come from, but for now just guess - $returnto = $rc->mAttribs['rc_type'] == RC_NEW ? 'Newpages' : 'Recentchanges'; + $returnto = $rc->getAttribute( 'rc_type' ) == RC_NEW ? 'Newpages' : 'Recentchanges'; $return = Title::makeTitle( NS_SPECIAL, $returnto ); # If it's left up to us, check that the user is allowed to patrol this edit @@ -1575,10 +1575,14 @@ class Article { } } - # Mark the edit as patrolled - RecentChange::markPatrolled( $rcid ); - PatrolLog::record( $rcid ); - wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, false ) ); + # Check that the revision isn't patrolled already + # Prevents duplicate log entries + if( !$rc->getAttribute( 'rc_patrolled' ) ) { + # Mark the edit as patrolled + RecentChange::markPatrolled( $rcid ); + PatrolLog::record( $rcid ); + wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, false ) ); + } # Inform the user $wgOut->setPageTitle( wfMsg( 'markedaspatrolled' ) );