From b91b32530e5ba7e12b4d1b07aafd2f156d5599c7 Mon Sep 17 00:00:00 2001 From: Klimov Paul Date: Wed, 22 Apr 2015 17:45:34 +0300 Subject: [PATCH] Fixed incorrect URL config processing at `yii\bootstrap\Nav::items` if route element is not a first one --- CHANGELOG.md | 1 + Nav.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5db1fe9..fd7214c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Yii Framework 2 bootstrap extension Change Log - Bug #18: `label` option ignored by `yii\bootstrap\Activefield::checkbox()` and `yii\bootstrap\Activefield::radio()` (mikehaertl) - Bug #5984: `yii\bootstrap\Activefield::checkbox()` caused browser to link label to the wrong input (cebe) +- Bug #7894: Fixed incorrect URL config processing at `yii\bootstrap\Nav::items` if route element is not a first one (nkovacs, klimov-paul) - Enh #29: Added support to list-groups for Collapse class (pana1990, skullcrasher) - Enh #2546: Added `visible` option to `yii\bootstrap\ButtonGroup::$buttons` (samdark, lukBarros) - Enh #7633: Added `ActionColumn::$buttonOptions` for defining HTML options to be added to the default buttons (cebe) diff --git a/Nav.php b/Nav.php index 498d86c..7195662 100644 --- a/Nav.php +++ b/Nav.php @@ -252,7 +252,9 @@ class Nav extends Widget } unset($item['url']['#']); if (count($item['url']) > 1) { - foreach (array_splice($item['url'], 1) as $name => $value) { + $params = $item['url']; + unset($params[0]); + foreach ($params as $name => $value) { if ($value !== null && (!isset($this->params[$name]) || $this->params[$name] != $value)) { return false; }