Log when User::saveSettings is called in read-only mode
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 6 Apr 2015 18:26:42 +0000 (11:26 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 6 Apr 2015 18:26:42 +0000 (11:26 -0700)
Change-Id: I56a1760f2e6bbda889590777b553a8dfda587590

includes/User.php

index 322f8af..d832cbd 100644 (file)
@@ -3586,7 +3586,13 @@ class User implements IDBAccessObject {
                global $wgAuth;
 
                if ( wfReadOnly() ) {
-                       return; // @TODO: caller should deal with this instead!
+                       // @TODO: caller should deal with this instead!
+                       // This should really just be an exception.
+                       MWExceptionHandler::logException( new DBExpectedError(
+                               null,
+                               "Could not update user with ID '{$this->mId}'; DB is read-only."
+                       ) );
+                       return;
                }
 
                $this->load();