From: Alexander Ebert Date: Sat, 15 Dec 2012 21:25:38 +0000 (+0100) Subject: Fixed handling of user options without a default value X-Git-Tag: 2.0.0_Beta_1~704^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5260006a086b7d00862cf25f37be10b041e763d7;p=GitHub%2FWoltLab%2FWCF.git Fixed handling of user options without a default value --- diff --git a/wcfsetup/install/files/lib/data/user/option/UserOptionEditor.class.php b/wcfsetup/install/files/lib/data/user/option/UserOptionEditor.class.php index f38a366a5d..e9ee004415 100644 --- a/wcfsetup/install/files/lib/data/user/option/UserOptionEditor.class.php +++ b/wcfsetup/install/files/lib/data/user/option/UserOptionEditor.class.php @@ -29,7 +29,7 @@ class UserOptionEditor extends DatabaseObjectEditor { WCF::getDB()->getEditor()->addColumn('wcf'.WCF_N.'_user_option_value', 'userOption'.$userOption->optionID, self::getColumnDefinition($parameters['optionType'])); // add the default value to this column - if (isset($parameters['defaultValue'])) { + if (isset($parameters['defaultValue']) && $parameters['defaultValue'] !== null) { $sql = "UPDATE wcf".WCF_N."_user_option_value SET userOption".$userOption->optionID." = ?"; $statement = WCF::getDB()->prepareStatement($sql); diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php index 856c793df9..213ee90a2c 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php @@ -62,9 +62,9 @@ class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallat */ protected function saveOption($option, $categoryName, $existingOptionID = 0) { // default values - $optionName = $optionType = $defaultValue = $validationPattern = $outputClass = $selectOptions = $enableOptions = $permissions = $options = ''; + $optionName = $optionType = $validationPattern = $outputClass = $selectOptions = $enableOptions = $permissions = $options = ''; $required = $editable = $visible = $searchable = $disabled = $askDuringRegistration = 0; - $showOrder = null; + $defaultValue = $showOrder = null; // get values if (isset($option['name'])) $optionName = $option['name'];