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

Change subject: More autodisable script fixes
......................................................................


More autodisable script fixes

* Load users from master, probably not useful until I4ffc8325 goes in
* Don't bother with extra query for 0 users at the end, stop when we get less
  users than our batch size limit.

Bug: T112352
Change-Id: Ie800a5aa3b134301ead75cc5b3ae112f29589e3c
---
M autodisablePref.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/autodisablePref.php b/autodisablePref.php
index 832ca94..cd48d42 100644
--- a/autodisablePref.php
+++ b/autodisablePref.php
@@ -48,13 +48,14 @@
                        );
                        foreach ( $results as $userRow ) {
                                $user = User::newFromId( $userRow->user_id );
+                               $user->load( User::READ_LATEST );
                                $user->setOption( 'visualeditor-autodisable', 
true );
                                $user->saveSettings();
                                $lastUserId = $userRow->user_id;
                        }
                        $this->output( "Added preference for " . 
$results->numRows() . " users.\n" );
                        wfWaitForSlaves();
-               } while ( $results->numRows() );
+               } while ( $results->numRows() == $this->mBatchSize );
                $this->output( "done.\n" );
        }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie800a5aa3b134301ead75cc5b3ae112f29589e3c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to