Browse Source

Fixed custom widget validation (#12629) (#12632)

tags/2.0.10
coderlex 8 years ago committed by Alexander Makarov
parent
commit
81df45014c
  1. 1
      framework/CHANGELOG.md
  2. 3
      framework/widgets/ActiveField.php

1
framework/CHANGELOG.md

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.10 under development
------------------------
- Bug #12629: Fixed `ActiveField::widget()` to call `adjustLabelFor()` for `InputWidget` descendants (coderlex)
- Bug #7670: Added `UrlNormalizer` for normalizing requests with and without trailing slashes (rob006, cronfy, klimov-paul)
- Bug #9027: Fixed descendant class of `yii\web\UploadedFile` returns parent instances in case invoked after it (andrewnester)
- Bug #12428: Fixed `yii\db\mysql\QueryBuilder` causes warning when insert default rows into a table without primary key (DrmagicE)

3
framework/widgets/ActiveField.php

@ -697,6 +697,9 @@ class ActiveField extends Component
$config['model'] = $this->model;
$config['attribute'] = $this->attribute;
$config['view'] = $this->form->getView();
if (in_array('yii\widgets\InputWidget', class_parents($class)) && isset($config['options'])) {
$this->adjustLabelFor($config['options']);
}
$this->parts['{input}'] = $class::widget($config);
return $this;

Loading…
Cancel
Save