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

Navigation Error #3453

Closed
crackAT opened this issue Mar 31, 2021 · 8 comments
Closed

Navigation Error #3453

crackAT opened this issue Mar 31, 2021 · 8 comments

Comments

@crackAT
Copy link

crackAT commented Mar 31, 2021

Bug Description

Call to a member function showUrl() on null

Getting an error when editing navigation
Gettinag an error when using \Statamic\Facades\Nav::find($type)

How to Reproduce

update to statamic 3.1.2 and call /navigation/header

Extra Detail

###Editing Navigation

[2021-03-31 11:01:03] stage.ERROR: Call to a member function showUrl() on null {"userId":1,"exception":"[object] (Error(code: 0): Call to a member function showUrl() on null at /stage/app/vendor/statamic/cms/src/Http/Controllers/CP/Structures/NavigationController.php:71)
[stacktrace]
#0 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Statamic\\Http\\Controllers\\CP\\Structures\\NavigationController->show(Object(Illuminate\\Http\\Request), Object(Statamic\\Structures\\Nav))
#1 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('show', Array)
#2 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Statamic\\Http\\Controllers\\CP\\Structures\\NavigationController), 'show')
#3 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()
#4 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Routing\\Route->run()
#5 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#6 /stage/app/vendor/statamic/cms/src/Http/Middleware/CP/CountUsers.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#7 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\CountUsers->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#8 /stage/app/vendor/statamic/cms/src/Http/Middleware/CP/Localize.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#9 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\Localize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#10 /stage/app/vendor/statamic/cms/src/Http/Middleware/CP/Authorize.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#11 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\Authorize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#12 /stage/app/vendor/statamic/cms/src/Http/Middleware/CP/AuthGuard.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#13 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\AuthGuard->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#14 /stage/app/vendor/statamic/cms/src/Http/Middleware/CP/ContactOutpost.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#15 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\ContactOutpost->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#16 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#17 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#18 /stage/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#19 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#20 /stage/app/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#21 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#22 /stage/app/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#23 /stage/app/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))
#24 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#25 /stage/app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#27 /stage/app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#29 /stage/app/vendor/statamic/cms/src/Http/Middleware/SwapExceptionHandler.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#30 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\SwapExceptionHandler->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#31 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#32 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#33 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#34 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#35 /stage/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#36 /stage/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#37 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#38 /stage/app/vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#39 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CheckMultisite->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#40 /stage/app/vendor/statamic/cms/src/Http/Middleware/CheckComposerJsonScripts.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#41 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CheckComposerJsonScripts->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#42 /stage/app/vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#43 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\PoweredByHeader->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#44 /stage/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#45 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\\Laravel\\Http\\SetRequestIpMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#46 /stage/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#47 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#48 /stage/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#49 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#50 /stage/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#51 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#52 /stage/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#53 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#54 /stage/app/vendor/fruitcake/laravel-cors/src/HandleCors.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#55 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#56 /stage/app/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#57 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#58 /stage/app/vendor/rbmh/statamic-redirects/src/Http/Middleware/HandleNotFound.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#59 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): RBMH\\StatamicRedirects\\Http\\Middleware\\HandleNotFound->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#60 /stage/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(46): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#61 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\\Laravel\\Tracing\\Middleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#62 /stage/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#63 /stage/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#64 /stage/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#65 /stage/app/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#66 {main}
"} 

###Using Nav::find(type)

Call to a member function handle() on null

  at vendor/statamic/cms/src/Stache/Stores/NavigationStore.php:44
     40▕     }
     41▕
     42▕     public function getItemKey($item)
     43▕     {
  ➜  44▕         return $item->handle();
     45▕     }
     46▕
     47▕     protected function getKeyFromPath($path)
     48▕     {

Environment

Statamic 3.1.2 Pro
Laravel 8.35.1
PHP 7.4.14
4rn0/statamic-v3-image-optimizer 1.0.7
aryehraber/statamic-logbook 2.0.1
phpsa/statamic-analytics 1.3.0
rbmh/statamic-filtered-terms-fieldtype 1.0.2
rbmh/statamic-location-fieldtype 1.0.3
rbmh/statamic-redirects 1.0.7
statamic/eloquent-driver 0.1.1

Install method (choose one):

  • Existing Laravel app
@jasonvarga
Copy link
Member

Thanks for the issue. In the future, use code blocks around stack traces otherwise the #1-#66 on each line will tag the corresponding GitHub issues 😄

@crackAT
Copy link
Author

crackAT commented Apr 14, 2021

Hi,
any chance to fix this issue in the next version? We are currently not able to change our Navigation.

Thanks

@jasonvarga
Copy link
Member

Can you show your content/navigation/header.yaml file?

@crackAT
Copy link
Author

crackAT commented Apr 14, 2021

Sure,

header.yaml.zip

@jasonvarga
Copy link
Member

Looks like your trees weren't migrated for some reason.

Try running php please updates:run 3.0

@crackAT
Copy link
Author

crackAT commented Apr 14, 2021

hmm running into another error:

Error: Call to a member function handle() on null
#38 /vendor/statamic/cms/src/Stache/Stores/NavigationStore.php(44): Statamic\Stache\Stores\NavigationStore::getItemKey
#37 /vendor/statamic/cms/src/Stache/Stores/Store.php(72): Statamic\Stache\Stores\Store::Statamic\Stache\Stores\{closure}
#36 /vendor/laravel/framework/src/Illuminate/Collections/Collection.php(473): Illuminate\Support\Collection::keyBy
#35 /vendor/statamic/cms/src/Stache/Stores/Store.php(73): Statamic\Stache\Stores\Store::getItemsFromFiles
#34 /vendor/statamic/cms/src/Stache/Indexes/Value.php(11): Statamic\Stache\Indexes\Value::getItems
#33 /vendor/statamic/cms/src/Stache/Indexes/Index.php(90): Statamic\Stache\Indexes\Index::update
#32 /vendor/statamic/cms/src/Stache/Indexes/Index.php(74): Statamic\Stache\Indexes\Index::load
#31 /vendor/statamic/cms/src/Stache/Indexes/Index.php(113): Statamic\Stache\Indexes\Index::forgetItem
#30 /vendor/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php(60): Illuminate\Support\HigherOrderCollectionProxy::Illuminate\Support\{closure}
#29 /vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(234): Illuminate\Support\Collection::each
#28 /vendor/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php(61): Illuminate\Support\HigherOrderCollectionProxy::__call
#27 /vendor/statamic/cms/src/Stache/Stores/Store.php(227): Statamic\Stache\Stores\Store::Statamic\Stache\Stores\{closure}
#26 /vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(234): Illuminate\Support\Collection::each
#25 /vendor/statamic/cms/src/Stache/Stores/Store.php(230): Statamic\Stache\Stores\Store::handleFileChanges
#24 /vendor/statamic/cms/src/Stache/Stores/Store.php(85): Statamic\Stache\Stores\Store::getItems
#23 /vendor/statamic/cms/src/Stache/Repositories/NavigationRepository.php(25): Statamic\Stache\Repositories\NavigationRepository::all
#22 /vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Support\Facades\Facade::__callStatic
#21 /vendor/statamic/cms/src/UpdateScripts/UseDedicatedTrees.php(47): Statamic\UpdateScripts\UseDedicatedTrees::updateNavs
#20 /vendor/statamic/cms/src/UpdateScripts/UseDedicatedTrees.php(22): Statamic\UpdateScripts\UseDedicatedTrees::update
#19 /vendor/statamic/cms/src/UpdateScripts/Manager.php(95): Statamic\UpdateScripts\Manager::Statamic\UpdateScripts\{closure}
#18 /vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(234): Illuminate\Support\Collection::each
#17 /vendor/statamic/cms/src/UpdateScripts/Manager.php(96): Statamic\UpdateScripts\Manager::runUpdatableScripts
#16 /vendor/statamic/cms/src/UpdateScripts/Manager.php(52): Statamic\UpdateScripts\Manager::runUpdatesForSpecificPackageVersion
#15 /vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Support\Facades\Facade::__callStatic
#14 /vendor/statamic/cms/src/Console/Commands/UpdatesRun.php(39): Statamic\Console\Commands\UpdatesRun::handle
#13 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}
#12 /vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\Util::unwrapIfClosure
#11 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\BoundMethod::callBoundMethod
#10 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::call
#9 /vendor/laravel/framework/src/Illuminate/Container/Container.php(611): Illuminate\Container\Container::call
#8 /vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Console\Command::execute
#7 /vendor/symfony/console/Command/Command.php(256): Symfony\Component\Console\Command\Command::run
#6 /vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Illuminate\Console\Command::run
#5 /vendor/symfony/console/Application.php(971): Symfony\Component\Console\Application::doRunCommand
#4 /vendor/symfony/console/Application.php(290): Symfony\Component\Console\Application::doRun
#3 /vendor/symfony/console/Application.php(166): Symfony\Component\Console\Application::run
#2 /vendor/laravel/framework/src/Illuminate/Console/Application.php(92): Illuminate\Console\Application::run
#1 /vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Foundation\Console\Kernel::handle
#0 /please(37): null

@jasonvarga
Copy link
Member

Run php artisan cache:clear then try again.

@crackAT
Copy link
Author

crackAT commented Apr 15, 2021

Working, thanks for help.

@crackAT crackAT closed this as completed Apr 15, 2021
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

3 participants