From bbc0226627116f2ed90fd2cd44763a49b2064039 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Fri, 17 Jan 2014 07:35:48 +0400 Subject: [PATCH 1/2] BaseHtml::activeDropDownList() fix for 'multiple' mode --- framework/helpers/BaseHtml.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/helpers/BaseHtml.php b/framework/helpers/BaseHtml.php index 4de696d210..9e1d74cc89 100644 --- a/framework/helpers/BaseHtml.php +++ b/framework/helpers/BaseHtml.php @@ -1222,6 +1222,9 @@ class BaseHtml */ public static function activeDropDownList($model, $attribute, $items, $options = []) { + if (!empty($options['multiple'])) { + return static::activeListBox($model, $attribute, $items, $options); + } $name = isset($options['name']) ? $options['name'] : static::getInputName($model, $attribute); $selection = static::getAttributeValue($model, $attribute); if (!array_key_exists('id', $options)) { From 0fe3245b26f682a8767c055a1f5a7064144ad77c Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Fri, 17 Jan 2014 07:36:24 +0400 Subject: [PATCH 2/2] BaseHtml::activeListBox() incorrect 'unselect' value fixed. --- framework/helpers/BaseHtml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/helpers/BaseHtml.php b/framework/helpers/BaseHtml.php index 9e1d74cc89..ce1e54e2f9 100644 --- a/framework/helpers/BaseHtml.php +++ b/framework/helpers/BaseHtml.php @@ -1276,7 +1276,7 @@ class BaseHtml $name = isset($options['name']) ? $options['name'] : static::getInputName($model, $attribute); $selection = static::getAttributeValue($model, $attribute); if (!array_key_exists('unselect', $options)) { - $options['unselect'] = '0'; + $options['unselect'] = ''; } if (!array_key_exists('id', $options)) { $options['id'] = static::getInputId($model, $attribute);