Fix #19508: Fix wrong selection for boolean attributes in GridView

This commit is contained in:
Aleksandr Dokin
2022-08-24 15:54:27 +03:00
committed by GitHub
parent 467bc89c45
commit d5e8849283
2 changed files with 3 additions and 3 deletions

View File

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

View File

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