diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 04ae2586f5..9b05947258 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -4,7 +4,7 @@ Yii Framework 2 Change Log 2.0.47 under development ------------------------ -- no changes in this release. +- Bug #19508: Fix wrong selection for boolean attributes in GridView (alnidok) 2.0.46 August 18, 2022 diff --git a/framework/grid/DataColumn.php b/framework/grid/DataColumn.php index d3bf3086dd..17ef73aa93 100644 --- a/framework/grid/DataColumn.php +++ b/framework/grid/DataColumn.php @@ -216,10 +216,10 @@ class DataColumn extends Column $error = ''; } if (is_array($this->filter)) { - $options = array_merge(['prompt' => ''], $this->filterInputOptions); + $options = array_merge(['prompt' => '', 'strict' => true], $this->filterInputOptions); return Html::activeDropDownList($model, $this->filterAttribute, $this->filter, $options) . $error; } elseif ($this->format === 'boolean') { - $options = array_merge(['prompt' => ''], $this->filterInputOptions); + $options = array_merge(['prompt' => '', 'strict' => true], $this->filterInputOptions); return Html::activeDropDownList($model, $this->filterAttribute, [ 1 => $this->grid->formatter->booleanFormat[1], 0 => $this->grid->formatter->booleanFormat[0],