From 5ea4bb6dc7f729835b5ace59721932f66e1b05de Mon Sep 17 00:00:00 2001 From: Hiren Bhut Date: Tue, 25 Apr 2023 13:21:59 +0530 Subject: [PATCH] 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' --- CHANGELOG.md | 1 + src/Nav.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62bd04b..00ccb58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Yii Framework 2 bootstrap5 extension Change Log 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) 2.0.4 November 30, 2022 diff --git a/src/Nav.php b/src/Nav.php index c8304e5..88d9063 100644 --- a/src/Nav.php +++ b/src/Nav.php @@ -278,7 +278,7 @@ class Nav extends Widget return false; } 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])) { $route = $item['url'][0];