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

Change subject: Avoid calling User::setPassword() on users not in database
......................................................................


Avoid calling User::setPassword() on users not in database

MediaWiki core change Id3d4074 is removing the ability to call
$user->setPassword() before the user is added to the database. This change
updates the extension to avoid such calls. It remains backwards-compatible with
older versions of MediaWiki through adding a saveSettings() call when
necessary.

Change-Id: I2c18f4831be42bc27549f4f98915753a1a82391d
---
M TranslationNotificationJob.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/TranslationNotificationJob.php b/TranslationNotificationJob.php
index fb90c37..02ad696 100644
--- a/TranslationNotificationJob.php
+++ b/TranslationNotificationJob.php
@@ -70,8 +70,8 @@
 
                // If user doesn't exist
                if ( !$user->getId() ) {
-                       $user->setPassword( $wgNotificationUserPassword );
                        $user->addToDatabase();
+                       $user->setPassword( $wgNotificationUserPassword );
                        $user->saveSettings();
                        // Increment site_stats.ss_users
                        $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2c18f4831be42bc27549f4f98915753a1a82391d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TranslationNotifications
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: GergÅ‘ Tisza <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to