Made addAutopromoteOnceGroups check wfReadOnly
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 26 Mar 2015 22:20:14 +0000 (15:20 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 26 Mar 2015 22:20:14 +0000 (15:20 -0700)
Change-Id: I2fecf6616dd00cd34647f67298583ea8ec2977c0

includes/User.php

index 46e3474..62613e6 100644 (file)
@@ -1388,7 +1388,7 @@ class User implements IDBAccessObject {
                global $wgAutopromoteOnceLogInRC, $wgAuth;
 
                $toPromote = array();
-               if ( $this->getId() ) {
+               if ( !wfReadOnly() && $this->getId() ) {
                        $toPromote = Autopromote::getAutopromoteOnceGroups( $this, $event );
                        if ( count( $toPromote ) ) {
                                $oldGroups = $this->getGroups(); // previous groups
@@ -1414,6 +1414,7 @@ class User implements IDBAccessObject {
                                }
                        }
                }
+
                return $toPromote;
        }