Skip to content

Commit

Permalink
Fix #19508: Fix wrong selection for boolean attributes in GridView
Browse files Browse the repository at this point in the history
  • Loading branch information
alnidok committed Aug 24, 2022
1 parent 467bc89 commit d5e8849
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions framework/grid/DataColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ protected function renderFilterCellContent()
$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],
Expand Down

0 comments on commit d5e8849

Please sign in to comment.