diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 7d1cdf0d50..6cad5c44b2 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -35,6 +35,7 @@ Yii Framework 2 Change Log - Bug #11973: Fixed `yii\helpers\BaseHtml::getAttributeValue()` to work with `items[]` notation correctly (silverfire) - Bug #12100: Fixed `yii\filters\HttpCache` was sending an empty Pragma header (sergeymakinen) - Bug #12107: Fixed REST Serializer to validate input for 'expand' and 'fields' parameter, which crashed on array input (njspok, cebe) +- Enh #12230: Allows BaseHtml::activeListInput to override the field value (RangelReale) 2.0.9 July 11, 2016 diff --git a/framework/helpers/BaseHtml.php b/framework/helpers/BaseHtml.php index d5e5fd6c28..be655cb713 100644 --- a/framework/helpers/BaseHtml.php +++ b/framework/helpers/BaseHtml.php @@ -1648,7 +1648,7 @@ class BaseHtml protected static function activeListInput($type, $model, $attribute, $items, $options = []) { $name = isset($options['name']) ? $options['name'] : static::getInputName($model, $attribute); - $selection = static::getAttributeValue($model, $attribute); + $selection = isset($options['value']) ? $options['value'] : static::getAttributeValue($model, $attribute); if (!array_key_exists('unselect', $options)) { $options['unselect'] = ''; }