Browse Source

Fixed issue with tabular input in ActiveField::radio and checkbox

tags/2.0.0-beta
Jacob Morrison 11 years ago
parent
commit
226c9f22d0
  1. 1
      framework/CHANGELOG.md
  2. 6
      framework/yii/widgets/ActiveField.php

1
framework/CHANGELOG.md

@ -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)

6
framework/yii/widgets/ActiveField.php

@ -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
{ {
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}'] = '';

Loading…
Cancel
Save