Nav::isItemActive(): Return value must be of type bool, int returned (#72)

* Update Nav.php

Due to Exception 'TypeError' with message 'yii\bootstrap5\Nav::isItemActive(): Return value must be of type bool, int returned'
This commit is contained in:
Hiren Bhut 2023-04-25 13:21:59 +05:30 committed by GitHub
parent 5d0e4911aa
commit 5ea4bb6dc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 bootstrap5 extension Change Log
2.0.5 under development 2.0.5 under development
----------------------- -----------------------
- Bug #72: Nav::isItemActive(): Return value must be of type bool, int returned (hirenbhut93)
- Bug #62: Navbar can now accept `collapseOptions` to be `false` (theblindfrog) - Bug #62: Navbar can now accept `collapseOptions` to be `false` (theblindfrog)
2.0.4 November 30, 2022 2.0.4 November 30, 2022

View File

@ -278,7 +278,7 @@ class Nav extends Widget
return false; return false;
} }
if (isset($item['active'])) { if (isset($item['active'])) {
return ArrayHelper::getValue($item, 'active', false); return (bool)ArrayHelper::getValue($item, 'active', false);
} }
if (isset($item['url']) && is_array($item['url']) && isset($item['url'][0])) { if (isset($item['url']) && is_array($item['url']) && isset($item['url'][0])) {
$route = $item['url'][0]; $route = $item['url'][0];