Browse Source

Fixes #4277: `yii\grid\GridView` is no longer throwing an exception in non-debug mode when results are empty and `columns` aren't defined

tags/2.0.1
Alexander Makarov 10 years ago
parent
commit
af50f5a290
  1. 3
      framework/CHANGELOG.md
  2. 2
      framework/grid/GridView.php

3
framework/CHANGELOG.md

@ -70,7 +70,8 @@ Yii Framework 2 Change Log
- Enh: `Console::confirm()` now uses `Console::stdout()` instead of `echo` to be consistent with all other functions (cebe) - Enh: `Console::confirm()` now uses `Console::stdout()` instead of `echo` to be consistent with all other functions (cebe)
- Enh: `yii\rbac\DbManager` migration now uses database component specified in component settings instead of always using default `db` (samdark) - Enh: `yii\rbac\DbManager` migration now uses database component specified in component settings instead of always using default `db` (samdark)
- Enh: Added `yii\base\Controller::renderContent()` (qiangxue) - Enh: Added `yii\base\Controller::renderContent()` (qiangxue)
- Chg #3630: `yii\db\Command::queryInternal()` is now protected (samdark) - Chg #3630: `yii\db\Command::queryInternal()` is now protected (samdark)
- Chg #4277: `yii\grid\GridView` is no longer throwing an exception in non-debug mode when results are empty and `columns` aren't defined (samdark)
- Chg #5508: Dropped the support for the `--append` option for the `fixture` command (qiangxue) - Chg #5508: Dropped the support for the `--append` option for the `fixture` command (qiangxue)
- Chg #5874: Upgraded Twitter Bootstrap to 3.3.x (samdark) - Chg #5874: Upgraded Twitter Bootstrap to 3.3.x (samdark)

2
framework/grid/GridView.php

@ -522,7 +522,7 @@ class GridView extends BaseListView
foreach ($model as $name => $value) { foreach ($model as $name => $value) {
$this->columns[] = $name; $this->columns[] = $name;
} }
} else { } elseif (YII_DEBUG) {
throw new InvalidConfigException('Unable to generate columns from the data. Please manually configure the "columns" property.'); throw new InvalidConfigException('Unable to generate columns from the data. Please manually configure the "columns" property.');
} }
} }

Loading…
Cancel
Save