Commit b71c8c76 by Qiang Xue

Merge pull request #1573 from jom/master

Fixed issue with tabular input in ActiveField::radio and checkbox
parents 702cf513 226c9f22
...@@ -12,6 +12,7 @@ Yii Framework 2 Change Log ...@@ -12,6 +12,7 @@ Yii Framework 2 Change Log
- Bug: Fixed `Call to a member function registerAssetFiles() on a non-object` in case of wrong `sourcePath` for an asset bundle (samdark) - Bug: Fixed `Call to a member function registerAssetFiles() on a non-object` in case of wrong `sourcePath` for an asset bundle (samdark)
- Bug: Fixed incorrect event name for `yii\jui\Spinner` (samdark) - Bug: Fixed incorrect event name for `yii\jui\Spinner` (samdark)
- Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe) - Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe)
- Bug: Fixed issue with tabular input on ActiveField::radio() and ActiveField::checkbox() (jom)
- Enh #1293: Replaced Console::showProgress() with a better approach. See Console::startProgress() for details (cebe) - Enh #1293: Replaced Console::showProgress() with a better approach. See Console::startProgress() for details (cebe)
- Enh #1406: DB Schema support for Oracle Database (p0larbeer, qiangxue) - Enh #1406: DB Schema support for Oracle Database (p0larbeer, qiangxue)
- Enh #1437: Added ListView::viewParams (qiangxue) - Enh #1437: Added ListView::viewParams (qiangxue)
......
...@@ -371,7 +371,8 @@ class ActiveField extends Component ...@@ -371,7 +371,8 @@ class ActiveField extends Component
{ {
if ($enclosedByLabel) { if ($enclosedByLabel) {
if (!isset($options['label'])) { if (!isset($options['label'])) {
$options['label'] = Html::encode($this->model->getAttributeLabel($this->attribute)); $attribute = Html::getAttributeName($this->attribute);
$options['label'] = Html::encode($this->model->getAttributeLabel($attribute));
} }
$this->parts['{input}'] = Html::activeRadio($this->model, $this->attribute, $options); $this->parts['{input}'] = Html::activeRadio($this->model, $this->attribute, $options);
$this->parts['{label}'] = ''; $this->parts['{label}'] = '';
...@@ -406,7 +407,8 @@ class ActiveField extends Component ...@@ -406,7 +407,8 @@ class ActiveField extends Component
{ {
if ($enclosedByLabel) { if ($enclosedByLabel) {
if (!isset($options['label'])) { if (!isset($options['label'])) {
$options['label'] = Html::encode($this->model->getAttributeLabel($this->attribute)); $attribute = Html::getAttributeName($this->attribute);
$options['label'] = Html::encode($this->model->getAttributeLabel($attribute));
} }
$this->parts['{input}'] = Html::activeCheckbox($this->model, $this->attribute, $options); $this->parts['{input}'] = Html::activeCheckbox($this->model, $this->attribute, $options);
$this->parts['{label}'] = ''; $this->parts['{label}'] = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment