jenkins-bot has submitted this change and it was merged.

Change subject: Replace removed ChangesList::newFromUser function
......................................................................


Replace removed ChangesList::newFromUser function

newFromUser() was removed during commit 94083 for MediaWiki 1.23.

Change-Id: I37c9ae531b466fa7347e8ee98731a0b2981997c1
---
M Patroller.php
M SpecialPatroller.php
M extension.json
3 files changed, 27 insertions(+), 27 deletions(-)

Approvals:
  Paladox: Looks good to me, but someone else must approve
  Cblair91: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Patroller.php b/Patroller.php
index d3ca513..dd02b45 100644
--- a/Patroller.php
+++ b/Patroller.php
@@ -27,23 +27,23 @@
        'name'                          => 'Patroller',
        'descriptionmsg'        => 'patrol-desc',
        'author'                        => 'Rob Church, Kris Blair (Cblair91)',
-       'version'                       => '2.0',
+       'version'                       => '2.0.1',
        'url'                           => 
'https://www.mediawiki.org/wiki/Extension:Patroller',
        'licence-name'          => 'GPL-2.0'
 ];
 
-# Register hooks
+// Register hooks
 $wgAutoloadClasses['PatrollerHooks']                   = __DIR__ . 
'/Patroller.hooks.php';
 $wgAutoloadClasses['SpecialPatroller']                                 = 
__DIR__ . '/SpecialPatroller.php';
 
 $wgHooks['LoadExtensionSchemaUpdates'][]               = 
'PatrollerHooks::onLoadExtensionSchemaUpdates';
 $wgSpecialPages['Patrol']                                              = 
'SpecialPatroller';
 
-# Register messages
+// Register messages
 $wgMessagesDir['Patroller']                                            = 
__DIR__ . '/i18n';
 $wgExtensionMessagesFiles['PatrollerAlias']            = __DIR__ . 
'/Patroller.alias.php';
 
-# Register rights
+// Register rights
 $wgAvailableRights[]                                                   = 
'patroller';
 $wgGroupPermissions['sysop']['patroller']              = true;
 $wgGroupPermissions['patroller']['patroller']  = true;
diff --git a/SpecialPatroller.php b/SpecialPatroller.php
index 41faa70..257ce26 100644
--- a/SpecialPatroller.php
+++ b/SpecialPatroller.php
@@ -36,27 +36,27 @@
 
                $this->setHeaders();
 
-               # Check permissions
+               // Check permissions
                if ( !$wgUser->isAllowed( 'patroller' ) ) {
                        throw new PermissionsError( 'patroller' );
                }
 
-               # Keep out blocked users
+               // Keep out blocked users
                if ( $wgUser->isBlocked() ) {
                        throw new UserBlockedError( $wgUser->getBlock() );
                }
 
-               # Prune old assignments if needed
+               // Prune old assignments if needed
                if ( 0 == mt_rand( 0, 499 ) ) {
                        $this->pruneAssignments();
                }
 
-               # See if something needs to be done
+               // See if something needs to be done
                if ( $wgRequest->wasPosted() && $wgUser->matchEditToken( 
$wgRequest->getText( 'wpToken' ) ) ) {
                        $rcid = $wgRequest->getIntOrNull( 'wpRcId' );
                        if ( $rcid ) {
                                if ( $wgRequest->getCheck( 'wpPatrolEndorse' ) 
) {
-                                       # Mark the change patrolled
+                                       // Mark the change patrolled
                                        if ( !$wgUser->isBlocked( false ) ) {
                                                RecentChange::markPatrolled( 
$rcid );
                                                $wgOut->setSubtitle( 
wfMessages( 'patrol-endorsed-ok' )->escaped() );
@@ -64,19 +64,19 @@
                                                $wgOut->setSubtitle( 
wgMessages( 'patrol-endorsed-failed' )->escaped() );
                                        }
                                } elseif ( $wgRequest->getCheck( 
'wpPatrolRevert' ) ) {
-                                       # Revert the change
+                                       // Revert the change
                                        $edit = $this->loadChange( $rcid );
                                        $msg = $this->revert( $edit, 
$this->revertReason( $wgRequest ) ) ? 'ok' : 'failed';
                                        $wgOut->setSubtitle( wgMessage( 
'patrol-reverted-' . $msg )->escaped() );
                                } elseif ( $wgRequest->getCheck( 'wpPatrolSkip' 
) ) {
-                                       # Do nothing
+                                       // Do nothing
                                        $wgOut->setSubtitle( wgMessage( 
'patrol-skipped-ok' )->escaped() );
                                }
                        }
                }
 
-               # If a token was passed, but the check box value was not, then 
the user
-               # wants to pause or stop patrolling
+               // If a token was passed, but the check box value was not, then 
the user
+               // wants to pause or stop patrolling
                if ( $wgRequest->getCheck( 'wpToken' ) && 
!$wgRequest->getCheck( 'wpAnother' ) ) {
                        $skin = $this->getSkin();
                        $self = SpecialPage::getTitleFor( 'Patrol' );
@@ -91,12 +91,12 @@
                        return;
                }
 
-               # Pop an edit off recentchanges
+               // Pop an edit off recentchanges
                $haveEdit = false;
                while ( !$haveEdit ) {
                        $edit = $this->fetchChange( $wgUser );
                        if ( $edit ) {
-                               # Attempt to assign it
+                               // Attempt to assign it
                                if ( $this->assignChange( $edit ) ) {
                                        $haveEdit = true;
                                        $this->showDiffDetails( $edit );
@@ -106,8 +106,8 @@
                                        $this->showControls( $edit );
                                }
                        } else {
-                               # Can't find a suitable edit
-                               $haveEdit = true; # Don't keep going, there's 
nothing to find
+                               // Can't find a suitable edit
+                               $haveEdit = true; // Don't keep going, there's 
nothing to find
                                $wgOut->addWikiText( wfMessage( 
'patrol-nonefound' )->text() );
                        }
                }
@@ -121,10 +121,10 @@
         * @return      void
         */
        private function showDiffDetails( &$edit ) {
-               global $wgUser, $wgOut;
+               global $wgOut;
                $edit->counter = 1;
                $edit->mAttribs['rc_patrolled'] = 1;
-               $list = ChangesList::newFromUser( $wgUser );
+               $list = ChangesList::newFromContext( RequestContext::GetMain() 
);
                $wgOut->addHTML(
                        $list->beginRecentChangesList()
                        . $list->recentChangesLine( $edit )
@@ -310,15 +310,15 @@
         */
        private function revert( &$edit, $comment = '' ) {
                global $wgUser;
-               if ( !$wgUser->isBlocked( false ) ) { # Check block against 
master
+               if ( !$wgUser->isBlocked( false ) ) { // Check block against 
master
                        $dbw = wfGetDB( DB_MASTER );
                        $title = $edit->getTitle();
-                       # Prepare the comment
+                       // Prepare the comment
                        $comment = wfMessage( 'patrol-reverting', $comment 
)->inContentLanguage()->text();
-                       # Find the old revision
+                       // Find the old revision
                        $old = Revision::newFromId( 
$edit->mAttribs['rc_last_oldid'] );
-                       # Be certain we're not overwriting a more recent change
-                       # If we would, ignore it, and silently consider this 
change patrolled
+                       // Be certain we're not overwriting a more recent change
+                       // If we would, ignore it, and silently consider this 
change patrolled
                        $latest = (int)$dbw->selectField(
                                'page',
                                'page_latest',
@@ -326,12 +326,12 @@
                                __METHOD__
                        );
                        if ( $edit->mAttribs['rc_this_oldid'] == $latest ) {
-                               # Revert the edit; keep the reversion itself 
out of recent changes
+                               // Revert the edit; keep the reversion itself 
out of recent changes
                                wfDebugLog( 'patroller', 'Reverting "' . 
$title->getPrefixedText() . '" to r' . $old->getId() );
                                $article = new Article( $title );
                                $article->doEdit( $old->getText(), $comment, 
EDIT_UPDATE & EDIT_MINOR & EDIT_SUPPRESS_RC );
                        }
-                       # Mark the edit patrolled so it doesn't bother us again
+                       // Mark the edit patrolled so it doesn't bother us again
                        RecentChange::markPatrolled( $edit->mAttribs['rc_id'] );
                        return true;
                } else {
diff --git a/extension.json b/extension.json
index b253080..4faf63c 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
        "name": "Patroller",
-       "version": "2.0",
+       "version": "2.0.1",
        "author": [
                "Rob Church",
                "Kris Blair (Cblair91)"

-- 
To view, visit https://gerrit.wikimedia.org/r/321228
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I37c9ae531b466fa7347e8ee98731a0b2981997c1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Patroller
Gerrit-Branch: master
Gerrit-Owner: Cblair91 <[email protected]>
Gerrit-Reviewer: Cblair91 <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to