Legoktm has uploaded a new change for review.

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

Change subject: Fix fatals in LoginUserMigrated hook
......................................................................

Fix fatals in LoginUserMigrated hook

This is a quick fix, long term we should look at the position of the
hook and whether it should come after the username has been validated.

Bug: T96145
Change-Id: I088a84b1362e3d1edd63a4dce22d4b2695929637
---
M includes/CentralAuthHooks.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/78/204278/1

diff --git a/includes/CentralAuthHooks.php b/includes/CentralAuthHooks.php
index f82ed19..3462d22 100644
--- a/includes/CentralAuthHooks.php
+++ b/includes/CentralAuthHooks.php
@@ -491,13 +491,13 @@
         * Inform a user that their username was renamed as part of SUL
         * Finalization, if their previous username doesn't exist any more 
(winner
         * was renamed).
-        * @param User $user
+        * @param User|bool $user
         * @param string &$msg return error key, or return an array with key 
and params
         * @return bool
         */
        public static function onLoginUserMigrated( $user, &$msg ) {
                global $wgCentralAuthCheckSULMigration;
-               if ( $wgCentralAuthCheckSULMigration ) {
+               if ( $wgCentralAuthCheckSULMigration && $user instanceof User ) 
{
                        $centralUser = CentralAuthUser::getInstance( $user );
                        if ( $user->getID() === 0 && !$centralUser->exists() ) {
                                // If the local and global accounts don't exist,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I088a84b1362e3d1edd63a4dce22d4b2695929637
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

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

Reply via email to