Commit 36ea0f32 by Qiang Xue

Fixes #5570: `yii\bootstrap\Tabs` would throw an exception if `content` is not…

Fixes #5570: `yii\bootstrap\Tabs` would throw an exception if `content` is not set for one of its `items` Fixes #5572.
parent 91b22b5e
......@@ -4,7 +4,7 @@ Yii Framework 2 bootstrap extension Change Log
2.0.1 under development
-----------------------
- no changes in this release.
- Bug #5570: `yii\bootstrap\Tabs` would throw an exception if `content` is not set for one of its `items` (RomeroMsk)
2.0.0 October 12, 2014
......
......@@ -156,7 +156,7 @@ class Tabs extends Widget
$linkOptions['data-toggle'] = 'dropdown';
$header = Html::a($label, "#", $linkOptions) . "\n"
. Dropdown::widget(['items' => $item['items'], 'clientOptions' => false, 'view' => $this->getView()]);
} elseif (isset($item['content'])) {
} else {
$options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', []));
$options['id'] = ArrayHelper::getValue($options, 'id', $this->options['id'] . '-tab' . $n);
......@@ -167,7 +167,7 @@ class Tabs extends Widget
}
$linkOptions['data-toggle'] = 'tab';
$header = Html::a($label, '#' . $options['id'], $linkOptions);
$panes[] = Html::tag('div', $item['content'], $options);
$panes[] = Html::tag('div', isset($item['content']) ? $item['content'] : '', $options);
}
$headers[] = Html::tag('li', $header, $headerOptions);
......@@ -183,7 +183,7 @@ class Tabs extends Widget
protected function hasActiveTab()
{
foreach ($this->items as $item) {
if (isset($item['active']) && $item['active']===true) {
if (isset($item['active']) && $item['active'] === true) {
return true;
}
}
......
......@@ -6,6 +6,7 @@ Yii Framework 2 Change Log
- Bug #4471: `yii\caching\ApcCache::getValues()` now returns array in case of APC is installed but not enabled in CLI mode (samdark, cebe)
- Bug #5402: Debugger was not loading when there were closures in asset classes (samdark)
- Bug #5570: `yii\bootstrap\Tabs` would throw an exception if `content` is not set for one of its `items` (RomeroMsk)
- Bug #5584: `yii\rbac\DbRbacManager` should not delete items when deleting a rule on a database not supporting cascade update (mdmunir)
- Bug #5601: Simple conditions in Query::where() and ActiveQuery::where() did not allow `yii\db\Expression` to be used as the value (cebe, stevekr)
- Bug #5657: `yii\caching\ApcCache::mset()` and `madd()` may cause warning in some APC setup (LAV45)
......
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