Fix #16145: Fix Html helper checkboxList(), radioList(), renderSelectOptions(), dropDownList(), listBox() methods to work properly with traversable selection

This commit is contained in:
Alexander Makarov
2020-03-24 12:55:35 +03:00
parent 1d6d0d76c5
commit 4de66f8205
3 changed files with 55 additions and 3 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.33 under development
------------------------
- Bug #16145: Fix `Html` helper `checkboxList()`, `radioList()`, `renderSelectOptions()`, `dropDownList()`, `listBox()` methods to work properly with traversable selection (samdark)
- Bug #17797: Fix for `activeListInput` options (alex-code)
- Bug #16092: Fix duplicate joins in usage of `joinWith` (germanow)
- Bug #17679: Fix Oracle exception "ORA-01461: can bind a LONG value only for insert into a LONG column" when inserting 4k+ string (vinpel, 243083df)

View File

@ -954,7 +954,7 @@ class BaseHtml
$name .= '[]';
}
if (ArrayHelper::isTraversable($selection)) {
$selection = array_map('strval', (array)$selection);
$selection = array_map('strval', ArrayHelper::toArray($selection));
}
$formatter = ArrayHelper::remove($options, 'item');
@ -1041,7 +1041,7 @@ class BaseHtml
public static function radioList($name, $selection = null, $items = [], $options = [])
{
if (ArrayHelper::isTraversable($selection)) {
$selection = array_map('strval', (array)$selection);
$selection = array_map('strval', ArrayHelper::toArray($selection));
}
$formatter = ArrayHelper::remove($options, 'item');
@ -1854,7 +1854,7 @@ class BaseHtml
public static function renderSelectOptions($selection, $items, &$tagOptions = [])
{
if (ArrayHelper::isTraversable($selection)) {
$selection = array_map('strval', (array)$selection);
$selection = array_map('strval', ArrayHelper::toArray($selection));
}
$lines = [];