From b6319d7b8f50d13d5ac7c24720bc5e133ef52212 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 30 Jan 2014 22:39:23 +0100 Subject: [PATCH] Fixed user search issue --- com.woltlab.wcf/templates/selectOptionType.tpl | 2 +- wcfsetup/install/files/acp/templates/selectOptionType.tpl | 2 +- .../files/lib/system/option/SelectOptionType.class.php | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/com.woltlab.wcf/templates/selectOptionType.tpl b/com.woltlab.wcf/templates/selectOptionType.tpl index 3ddf5f984d..98d1893d64 100644 --- a/com.woltlab.wcf/templates/selectOptionType.tpl +++ b/com.woltlab.wcf/templates/selectOptionType.tpl @@ -1,5 +1,5 @@ - {if $option->allowEmptyValue}{/if} + {if $allowEmptyValue}{/if} {foreach from=$selectOptions key=key item=selectOption} {/foreach} diff --git a/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php b/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php index 6ecd3b4e32..98f540b6d7 100644 --- a/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php @@ -14,6 +14,8 @@ use wcf\system\WCF; * @category Community Framework */ class SelectOptionType extends RadioButtonOptionType { + protected $allowEmptyValue = false; + /** * @see \wcf\system\option\IOptionType::getFormElement() */ @@ -26,7 +28,8 @@ class SelectOptionType extends RadioButtonOptionType { 'enableOptions' => $options['enableOptions'], 'option' => $option, 'selectOptions' => $option->parseSelectOptions(), - 'value' => $value + 'value' => $value, + 'allowEmptyValue' => ($this->allowEmptyValue || $option->allowEmptyValue) )); return WCF::getTPL()->fetch('selectOptionType'); } @@ -35,6 +38,7 @@ class SelectOptionType extends RadioButtonOptionType { * @see \wcf\system\option\ISearchableUserOption::getSearchFormElement() */ public function getSearchFormElement(Option $option, $value) { + $this->allowEmptyValue = true; return $this->getFormElement($option, $value); } -- 2.20.1