Browse Source

Fixes #15625: `yii\grid\DataColumn` boolean filter dropdown list values are now in reversed order

tags/2.0.14
Bizley 7 years ago committed by Alexander Makarov
parent
commit
dbb49b436b
  1. 1
      framework/CHANGELOG.md
  2. 4
      framework/grid/DataColumn.php
  3. 2
      tests/framework/grid/DataColumnTest.php

1
framework/CHANGELOG.md

@ -97,6 +97,7 @@ Yii Framework 2 Change Log
- Enh #15422: Added default roles dynamic definition support via closure for `yii\rbac\BaseManager` (deltacube) - Enh #15422: Added default roles dynamic definition support via closure for `yii\rbac\BaseManager` (deltacube)
- Enh: Added check to `yii\base\Model::formName()` to prevent source path disclosure when form is represented by an anonymous class (silverfire) - Enh: Added check to `yii\base\Model::formName()` to prevent source path disclosure when form is represented by an anonymous class (silverfire)
- Chg #15420: Handle OPTIONS request in `yii\filter\Cors` so the preflight check isn't passed trough authentication filters (michaelarnauts, leandrogehlen) - Chg #15420: Handle OPTIONS request in `yii\filter\Cors` so the preflight check isn't passed trough authentication filters (michaelarnauts, leandrogehlen)
- Chg #15625: `yii\grid\DataColumn` boolean filter dropdown list values are now in reversed order (bizley)
- Enh #15595: `yii\data\DataFilter` can now handle `lt`,`gt`,`lte` and `gte` on `yii\validators\DateValidator` (mikk150) - Enh #15595: `yii\data\DataFilter` can now handle `lt`,`gt`,`lte` and `gte` on `yii\validators\DateValidator` (mikk150)
- Bug #15621: Fixed `yii\web\User::getIdentity()` returning `null` if an exception had been thrown when it was called previously (brandonkelly) - Bug #15621: Fixed `yii\web\User::getIdentity()` returning `null` if an exception had been thrown when it was called previously (brandonkelly)

4
framework/grid/DataColumn.php

@ -202,8 +202,8 @@ class DataColumn extends Column
} elseif ($this->format === 'boolean') { } elseif ($this->format === 'boolean') {
$options = array_merge(['prompt' => ''], $this->filterInputOptions); $options = array_merge(['prompt' => ''], $this->filterInputOptions);
return Html::activeDropDownList($model, $this->attribute, [ return Html::activeDropDownList($model, $this->attribute, [
$this->grid->formatter->booleanFormat[0], 1 => $this->grid->formatter->booleanFormat[1],
$this->grid->formatter->booleanFormat[1], 0 => $this->grid->formatter->booleanFormat[0],
], $options) . $error; ], $options) . $error;
} }

2
tests/framework/grid/DataColumnTest.php

@ -190,8 +190,8 @@ HTML
$this->assertEqualsWithoutLE(<<<'HTML' $this->assertEqualsWithoutLE(<<<'HTML'
<select class="form-control" name="Order[customer_id]"> <select class="form-control" name="Order[customer_id]">
<option value=""></option> <option value=""></option>
<option value="0">No</option>
<option value="1">Yes</option> <option value="1">Yes</option>
<option value="0">No</option>
</select> </select>
HTML HTML
, $result); , $result);

Loading…
Cancel
Save