* small fix #19530

* small fix #19530 | fix test

* small fix #19530 | fix test

* small fix #19530 | fix test

* small fix #19530 | update CHANGELOG.md

* Update framework/CHANGELOG.md

Co-authored-by: viktor.shumeiko <viktor.shumeiko@simbirsoft.com>
Co-authored-by: Alexey Rogachev <arogachev90@gmail.com>
This commit is contained in:
Victor Shumeyko
2022-09-05 14:32:20 +03:00
committed by GitHub
parent 5358724251
commit 0ababa2d36
3 changed files with 4 additions and 3 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.47 under development
------------------------
- Bug #19530: Fix specifying the field id for `yii\widgets\ActiveField` (kv4nt)
- Bug #12636: Fix CompareValidator successful state when compareAttribute has an error (manchenkoff)
- Bug #15500: Fix saving empty records to MySQL (manchenkoff)
- Bug #14388: Fixed fixture loading order in output message (manchenkoff)

View File

@ -847,7 +847,7 @@ class ActiveField extends Component
$options = [];
$inputID = $this->getInputId();
$options['id'] = Html::getInputId($this->model, $this->attribute);
$options['id'] = $inputID ?: Html::getInputId($this->model, $this->attribute);
$options['name'] = $this->attribute;
$options['container'] = isset($this->selectors['container']) ? $this->selectors['container'] : ".field-$inputID";

View File

@ -460,7 +460,7 @@ EOD;
$actualValue = $this->activeField->getClientOptions();
$this->assertArraySubset([
'id' => 'activefieldtestmodel-attributename',
'id' => 'custom-input-id',
'name' => $this->attributeName,
'container' => '.field-custom-input-id',
'input' => '#custom-input-id',
@ -470,7 +470,7 @@ EOD;
$actualValue = $this->activeField->getClientOptions();
$this->assertArraySubset([
'id' => 'activefieldtestmodel-attributename',
'id' => 'custom-textinput-id',
'name' => $this->attributeName,
'container' => '.field-custom-textinput-id',
'input' => '#custom-textinput-id',