Captured via Sentry when loading the Craft CP. It would seem either $oldNavItems and/or $newNavItems might not be an array or integer in some cases and potentially needs to be more defensive before calling count?
Exception
ErrorException: Warning: count(): Parameter must be an array or an object that implements Countable
File "/vendor/verbb/cp-nav/src/services/Service.php", line 91, in verbb\cpnav\services\Service::checkUpdatedNavItems
if (count($oldNavItems) < count($newNavItems)) {
File "/vendor/verbb/cp-nav/src/CpNav.php", line 97, in verbb\cpnav\CpNav::verbb\cpnav\{closure}
$this->getService()->checkUpdatedNavItems($event);
File "/vendor/yiisoft/yii2/base/Event.php", line 312, in yii\base\Event::trigger
call_user_func($handler[0], $event);
File "/vendor/yiisoft/yii2/base/Component.php", line 636, in yii\base\Component::trigger
Event::trigger($this, $name, $event);
File "/vendor/craftcms/cms/src/web/twig/variables/Cp.php", line 280, in craft\web\twig\variables\Cp::nav
$this->trigger(self::EVENT_REGISTER_CP_NAV_ITEMS, $event);
Description
Captured via Sentry when loading the Craft CP. It would seem either
$oldNavItems
and/or$newNavItems
might not be an array or integer in some cases and potentially needs to be more defensive before calling count?