Fix missing setting of the default value if it was "0"
authorMarcel Werk <burntime@woltlab.com>
Thu, 1 Aug 2024 09:55:52 +0000 (11:55 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 1 Aug 2024 09:55:52 +0000 (11:55 +0200)
wcfsetup/install/files/lib/data/user/UserEditor.class.php

index 36c19598ecd632d8e74a92d0b47256a382ee742d..ef81052a58e9d816111fce765a099083f4dd1d01 100644 (file)
@@ -125,13 +125,12 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject
             self::$userOptionDefaultValues = [];
 
             $sql = "SELECT  optionID, defaultValue
-                    FROM    wcf" . WCF_N . "_user_option";
+                    FROM    wcf" . WCF_N . "_user_option
+                    WHERE   defaultValue IS NOT NULL";
             $statement = WCF::getDB()->prepareStatement($sql);
             $statement->execute();
             while ($row = $statement->fetchArray()) {
-                if (!empty($row['defaultValue'])) {
-                    self::$userOptionDefaultValues[$row['optionID']] = $row['defaultValue'];
-                }
+                self::$userOptionDefaultValues[$row['optionID']] = $row['defaultValue'];
             }
         }