diff --git a/resources/views/partials/nav-main.blade.php b/resources/views/partials/nav-main.blade.php index 0cef258e489..c9f4f83e353 100644 --- a/resources/views/partials/nav-main.blade.php +++ b/resources/views/partials/nav-main.blade.php @@ -2,41 +2,90 @@ use function Statamic\trans as __; @endphp -@section('nav-main') - +@section("nav-main") + @stop -@yield('nav-main') +@yield("nav-main") diff --git a/src/CP/Navigation/NavBuilder.php b/src/CP/Navigation/NavBuilder.php index 978eb88c76d..1179471fefb 100644 --- a/src/CP/Navigation/NavBuilder.php +++ b/src/CP/Navigation/NavBuilder.php @@ -102,7 +102,6 @@ protected function trackChildrenClosures() protected function resolveChildrenClosures() { collect($this->items) - ->filter(fn ($item) => $item->isActive() || $this->withHidden) ->each(fn ($item) => $item->resolveChildren()); return $this; diff --git a/tests/CP/Navigation/ActiveNavItemTest.php b/tests/CP/Navigation/ActiveNavItemTest.php index 8607d52898d..bebf4021c45 100644 --- a/tests/CP/Navigation/ActiveNavItemTest.php +++ b/tests/CP/Navigation/ActiveNavItemTest.php @@ -2,7 +2,6 @@ namespace Tests\CP\Navigation; -use Closure; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Request; @@ -81,8 +80,8 @@ public function it_resolves_all_children_only_once_to_build_caches_for_is_active $this->assertTrue(Blink::has(NavBuilder::UNRESOLVED_CHILDREN_URLS_CACHE_KEY)); $this->assertTrue(Cache::has(NavBuilder::ALL_URLS_CACHE_KEY)); $this->assertTrue(Blink::has(NavBuilder::ALL_URLS_CACHE_KEY)); - $this->assertInstanceOf(Closure::class, $this->getItemByDisplay($nav->get('Content'), 'Collections')->children()); - $this->assertInstanceOf(Closure::class, $this->getItemByDisplay($nav->get('Content'), 'Taxonomies')->children()); + $this->assertInstanceOf(Collection::class, $this->getItemByDisplay($nav->get('Content'), 'Collections')->children()); + $this->assertInstanceOf(Collection::class, $this->getItemByDisplay($nav->get('Content'), 'Taxonomies')->children()); } #[Test] @@ -155,7 +154,7 @@ public function it_builds_core_children_closure_when_not_active() $collections = $this->buildAndGetItem('Content', 'Collections'); $this->assertFalse($collections->isActive()); - $this->assertInstanceOf(Closure::class, $collections->children()); + $this->assertInstanceOf(Collection::class, $collections->children()); } #[Test] @@ -332,7 +331,7 @@ public function it_builds_extension_children_closure_when_not_active() $seoPro = $this->buildAndGetItem('Tools', 'SEO Pro'); $this->assertFalse($seoPro->isActive()); - $this->assertInstanceOf(Closure::class, $seoPro->children()); + $this->assertInstanceOf(Collection::class, $seoPro->children()); } #[Test]