Merge pull request #12230 from RangelReale/activelistvalue

Allows BaseHtml::activeListInput to override the field value
This commit is contained in:
Dmitry Naumenko
2016-08-22 17:34:18 +03:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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'] = '';
}