From 28802cc5348b173729a87c90f9d3358b23b3e138 Mon Sep 17 00:00:00 2001 From: Tam Date: Thu, 27 Sep 2018 22:12:27 +0200 Subject: [PATCH] Fixed issue when used with Verbb's Control Panel Nav plugin Fixes #2, Fixes #4, Closes #3 --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/TagManager.php | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cd9b6b..dc8a155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.1 - 2018-09-27 +### Fixed +- Fixed a bug when using Verbb's Control Panel Nav plugin + ## 1.0.0 ### Added - Initial release diff --git a/composer.json b/composer.json index cbf7e39..84eafca 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "ether/tags", "description": "A tag manager for Craft 3", "type": "craft-plugin", - "version": "1.0.0", + "version": "1.0.1", "keywords": [ "craft", "cms", diff --git a/src/TagManager.php b/src/TagManager.php index 3602f86..3d6ad15 100644 --- a/src/TagManager.php +++ b/src/TagManager.php @@ -104,13 +104,14 @@ public function onRegisterTagActions (RegisterElementActionsEvent $event) public function onRegisterCpNavItems (RegisterCpNavItemsEvent $event) { $navItems = $event->navItems; + $navItemKeys = array_keys($navItems); $i = count($navItems); $tagsNavItemIndex = null; while (--$i) { - $item = $navItems[$i]; + $item = $navItems[$navItemKeys[$i]]; $url = array_key_exists('url', $item) ? $item['url'] : null; if ($url === 'tags')