Fixed select user options
authorMarcel Werk <burntime@woltlab.com>
Fri, 26 Apr 2013 15:02:11 +0000 (17:02 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 26 Apr 2013 15:02:11 +0000 (17:02 +0200)
com.woltlab.wcf/template/selectOptionType.tpl
wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php

index 25332e39d27cc1c31acc1d4b3740a93bf2c15e8b..e0e2ce6cdf6d3df8e23626a6ffbc198051ff5329 100644 (file)
@@ -1,5 +1,5 @@
 <select id="{$option->optionName}" name="values[{$option->optionName}]">
-       <option value=""></option>
+       {if $option->allowEmptyValue}<option value=""></option>{/if}
        {foreach from=$selectOptions key=key item=selectOption}
                <option value="{$key}"{if $value == $key} selected="selected"{/if}>{lang}{@$selectOption}{/lang}</option>
        {/foreach}
index 93342d07b918038dcf71addeee34bfbf382e788a..229c32543e8f7baceaac95018406e82a1e5a697d 100644 (file)
@@ -232,7 +232,8 @@ class UserOptionAddForm extends AbstractForm {
                        'searchable' => $this->searchable,
                        'editable' => $this->editable,
                        'visible' => $this->visible,
-                       'packageID' => 1
+                       'packageID' => 1,
+                       'additionalData' => ($this->optionType == 'select' ? serialize(array('allowEmptyValue' => true)) : '')
                )));
                $this->objectAction->executeAction();