Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250023

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: Iebd35314c232b0e7285a289f2897b7b49c27d7ae
---
M utils/TranslateSandbox.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/23/250023/1

diff --git a/utils/TranslateSandbox.php b/utils/TranslateSandbox.php
index 84ab985..8bb7ed0 100644
--- a/utils/TranslateSandbox.php
+++ b/utils/TranslateSandbox.php
@@ -26,13 +26,15 @@
                }
 
                $user->setEmail( $email );
-               $user->setPassword( $password );
                $status = $user->addToDatabase();
 
                if ( !$status->isOK() ) {
                        throw new MWException( $status->getWikiText() );
                }
 
+               $user->setPassword( $password );
+               $user->saveSettings();
+
                // Need to have an id first
                $user->addGroup( 'translate-sandboxed' );
                $user->clearInstanceCache( 'name' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iebd35314c232b0e7285a289f2897b7b49c27d7ae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

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

Reply via email to