Improve markpatrolled hook
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 21 Dec 2008 08:49:45 +0000 (08:49 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 21 Dec 2008 08:49:45 +0000 (08:49 +0000)
docs/hooks.txt
includes/RecentChange.php

index c9daed9..41f5587 100644 (file)
@@ -897,7 +897,7 @@ $variableIDs: array of strings
                of Skin::makeVariablesScript
 
 'MarkPatrolled': before an edit is marked patrolled
-$rcid: ID of the revision to be marked patrolled
+$rc: RecentChange object of the revision to be marked patrolled
 $user: the user (object) marking the revision as patrolled
 $wcOnlySysopsCanPatrol: config setting indicating whether the user
  needs to be a sysop in order to mark an edit patrolled
index 010770c..ff4624f 100644 (file)
@@ -268,7 +268,7 @@ class RecentChange
                // Automatic patrol needs "autopatrol", ordinary patrol needs "patrol"
                $right = $auto ? 'autopatrol' : 'patrol';
                $errors = array_merge( $errors, $this->getTitle()->getUserPermissionsErrors( $right, $wgUser ) );
-               if( !wfRunHooks('MarkPatrolled', array($this->getAttribute('rc_id'), &$wgUser, false)) ) {
+               if( !wfRunHooks('MarkPatrolled', array($this, &$wgUser, false)) ) {
                        $errors[] = array('hookaborted');
                }
                // Users without the 'autopatrol' right can't patrol their