Avoid CAS update errors on password reset
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 22 Dec 2015 04:17:36 +0000 (20:17 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 22 Dec 2015 04:17:36 +0000 (20:17 -0800)
This could be caused by double posts or hook conflicts.

Bug: T95839
Change-Id: If362c8d0c9f9ded76b185cd717638b06775be885

includes/specials/SpecialPreferences.php

index 49ab6d5..b45946f 100644 (file)
@@ -128,7 +128,7 @@ class SpecialPreferences extends SpecialPage {
                        throw new PermissionsError( 'editmyoptions' );
                }
 
-               $user = $this->getUser();
+               $user = $this->getUser()->getInstanceForUpdate();
                $user->resetOptions( 'all', $this->getContext() );
                $user->saveSettings();