Fixed 'apply changes to existing users' option
authorMarcel Werk <burntime@woltlab.com>
Sun, 22 Dec 2013 22:48:55 +0000 (23:48 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sun, 22 Dec 2013 22:48:55 +0000 (23:48 +0100)
wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php

index 2d593cb10e65a5d09635a6e8dc2cc0197e38bfbb..6fee15a55fc18868b5577e1c9f063f05baec1fdf 100644 (file)
@@ -77,15 +77,6 @@ class UserOptionSetDefaultsForm extends AbstractForm {
                // get new values
                $saveOptions = $this->optionHandler->save();
                
-               // save values
-               $sql = "UPDATE  wcf".WCF_N."_user_option
-                       SET     defaultValue = ?
-                       WHERE   optionID = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               foreach ($saveOptions as $optionID => $value) {
-                       $statement->execute(array($value, $optionID));
-               }
-               
                // apply changes
                if ($this->applyChangesToExistingUsers) {
                        $optionIDs = array_keys($saveOptions);
@@ -112,6 +103,15 @@ class UserOptionSetDefaultsForm extends AbstractForm {
                        }
                }
                
+               // save values
+               $sql = "UPDATE  wcf".WCF_N."_user_option
+                       SET     defaultValue = ?
+                       WHERE   optionID = ?";
+               $statement = WCF::getDB()->prepareStatement($sql);
+               foreach ($saveOptions as $optionID => $value) {
+                       $statement->execute(array($value, $optionID));
+               }
+               
                // reset cache
                UserOptionCacheBuilder::getInstance()->reset();
                $this->saved();