Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global and nav with the same handle will collide #10612

Open
robdekort opened this issue Aug 12, 2024 · 3 comments
Open

Global and nav with the same handle will collide #10612

robdekort opened this issue Aug 12, 2024 · 3 comments

Comments

@robdekort
Copy link
Contributor

robdekort commented Aug 12, 2024

Bug description

Lets say you:

  1. Create a global called footer.
  2. Create a nav called footer.
  3. Run {{ nav:footer }}
  4. Get a Statamic\Tags\Structure::ensureStructureExists() error.

Stuff starts working when you do {{ nav handle="footer" }} instead.

How to reproduce

Do the above.

Logs

[2024-08-12 10:41:56] local.ERROR: Statamic\Tags\Structure::ensureStructureExists(): Argument #1 ($handle) must be of type string, Statamic\Globals\Variables given, called in /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Tags/Structure.php on line 56 {"userId":"ceaa75bd-bc37-4a8b-b0f2-b7af70e58b0e","exception":"[object] (TypeError(code: 0): Statamic\\Tags\\Structure::ensureStructureExists(): Argument #1 ($handle) must be of type string, Statamic\\Globals\\Variables given, called in /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Tags/Structure.php on line 56 at /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Tags/Structure.php:70)
[stacktrace]
#0 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Tags/Structure.php(56): Statamic\\Tags\\Structure->ensureStructureExists(Object(Statamic\\Globals\\Variables))
#1 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Tags/Structure.php(42): Statamic\\Tags\\Structure->structure(Object(Statamic\\Globals\\Variables))
#2 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Tags/Tags.php(152): Statamic\\Tags\\Structure->wildcard('footer')
#3 [internal function]: Statamic\\Tags\\Tags->__call('footer', Array)
#4 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(1597): call_user_func(Array)
#5 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(750): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->reduce(Array)
#6 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(381): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->render(Array)
#7 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(773): Statamic\\View\\Antlers\\Language\\Runtime\\RuntimeParser->renderText('{{#\\n    @name F...', Array)
#8 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Engine.php(93): Statamic\\View\\Antlers\\Language\\Runtime\\RuntimeParser->parseView('/Users/robdekor...', '{{#\\n    @name F...', Array)
#9 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/View/View.php(208): Statamic\\View\\Antlers\\Engine->get('/Users/robdekor...', Array)
#10 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/View/View.php(191): Illuminate\\View\\View->getContents()
#11 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/View/View.php(160): Illuminate\\View\\View->renderContents()
#12 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Tags/Partial.php(29): Illuminate\\View\\View->render()
#13 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Tags/Partial.php(13): Statamic\\Tags\\Partial->render('layout/footer')
#14 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Tags/Tags.php(152): Statamic\\Tags\\Partial->wildcard('layout/footer')
#15 [internal function]: Statamic\\Tags\\Tags->__call('layout/footer', Array)
#16 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(1597): call_user_func(Array)
#17 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(750): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->reduce(Array)
#18 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(381): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->render(Array)
#19 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(773): Statamic\\View\\Antlers\\Language\\Runtime\\RuntimeParser->renderText('{{#\\n    @name L...', Array)
#20 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/Antlers/Engine.php(93): Statamic\\View\\Antlers\\Language\\Runtime\\RuntimeParser->parseView('/Users/robdekor...', '{{#\\n    @name L...', Array)
#21 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/View/View.php(208): Statamic\\View\\Antlers\\Engine->get('/Users/robdekor...', Array)
#22 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/View/View.php(191): Illuminate\\View\\View->getContents()
#23 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/View/View.php(160): Illuminate\\View\\View->renderContents()
#24 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/View/View.php(132): Illuminate\\View\\View->render()
#25 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Responses/DataResponse.php(146): Statamic\\View\\View->render()
#26 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Responses/DataResponse.php(42): Statamic\\Http\\Responses\\DataResponse->contents()
#27 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Structures/Page.php(420): Statamic\\Http\\Responses\\DataResponse->toResponse(Object(Illuminate\\Http\\Request))
#28 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Routing/Router.php(902): Statamic\\Structures\\Page->toResponse(Object(Illuminate\\Http\\Request))
#29 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Routing/Router.php(887): Illuminate\\Routing\\Router::toResponse(Object(Illuminate\\Http\\Request), Object(Statamic\\Structures\\Page))
#30 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Routing\\Router->prepareResponse(Object(Illuminate\\Http\\Request), Object(Statamic\\Structures\\Page))
#31 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#32 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(65): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#33 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(60): Statamic\\StaticCaching\\Middleware\\Cache->handleRequest(Object(Illuminate\\Http\\Request), Object(Closure))
#34 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Cache/Lock.php(127): Statamic\\StaticCaching\\Middleware\\Cache->Statamic\\StaticCaching\\Middleware\\{closure}()
#35 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(60): Illuminate\\Cache\\Lock->block(30, Object(Closure))
#36 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\StaticCaching\\Middleware\\Cache->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#37 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/AuthGuard.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#38 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\AuthGuard->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#39 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/AddViewPaths.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#40 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\AddViewPaths->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#41 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/Localize.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#42 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\Localize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#43 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/HandleToken.php(13): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#44 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\HandleToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#45 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/StacheLock.php(29): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#46 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\StacheLock->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#47 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#48 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(88): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#53 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#54 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))
#55 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#56 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#57 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#58 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(75): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#59 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#60 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#61 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#62 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Routing/Router.php(786): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#63 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Routing/Router.php(750): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#64 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Routing/Router.php(739): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#65 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(201): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#66 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#67 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/StopImpersonating.php(12): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#68 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\StopImpersonating->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#69 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/DisableFloc.php(17): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#70 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\DisableFloc->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#71 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php(15): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#72 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CheckMultisite->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#73 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/CheckComposerJsonScripts.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#74 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CheckComposerJsonScripts->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#75 /Users/robdekort/Sites/statamic-peak-dev/vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#76 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\PoweredByHeader->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#77 /Users/robdekort/Sites/statamic-peak-dev/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#78 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#79 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#80 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#81 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#82 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#83 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(51): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#84 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#85 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#86 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#87 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(110): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#88 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#89 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#90 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#91 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#92 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#93 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#94 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#95 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#96 /Users/robdekort/Sites/statamic-peak-dev/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1188): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#97 /Users/robdekort/Sites/statamic-peak-dev/public/index.php(17): Illuminate\\Foundation\\Application->handleRequest(Object(Illuminate\\Http\\Request))
#98 /Applications/Herd.app/Contents/Resources/valet/server.php(155): require('/Users/robdekor...')
#99 {main}
"}

Environment

Environment
Application Name: Statamic Peak Development
Laravel Version: 11.19.0
PHP Version: 8.2.22
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: statamic-peak.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 4
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.19.0 PRO

Statamic Addons
studio1902/statamic-peak-browser-appearance: 3.5.0
studio1902/statamic-peak-commands: 8.4.2
studio1902/statamic-peak-seo: 8.15.3
studio1902/statamic-peak-tools: 6.3.0

Installation

Starter Kit using via CLI

Additional details

No response

@duncanmcclean
Copy link
Member

duncanmcclean commented Aug 14, 2024

This sounds like an Antlers bug to me. It passes the footer global as the nav handle, rather than the footer handle being specified.

@jasonvarga
Copy link
Member

This is intentional but in hindsight kinda dumb.

We can't change it now though, as some people might be relying on this behavior.

The use case is something like this:

{{ nav:a_field_where_you_picked_a_nav }}
  ...
{{ /nav:a_field_where_you_picked_a_nav }}

For v6 we can remove that behavior, and if people want to reference a field they could do {{ nav :handle="a_field_where_you_picked_a_nav" }}

For now, just stick with your workaround.

@robdekort
Copy link
Contributor Author

Gotcha 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants