Problem/Motivation
Error changing layout with layout builder.
LogicException: No menu name provided for menu.active_trails cache context. in Drupal\Core\Cache\Context\MenuActiveTrailsCacheContext->getCacheableMetadata() (line 44 of core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php).
Drupal\Core\Cache\Context\CacheContextsManager->optimizeTokens(Array) (Line: 158)
Drupal\Core\EventSubscriber\FinishResponseSubscriber->onRespond(Object, 'kernel.response', Object)
call_user_func(Array, Object, 'kernel.response', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.response') (Line: 191)
Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 179)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 706)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Steps to reproduce
* Enable Full Content display
* Enable Layout Builder
* Try to edit Layout with layout builder . It will throw the error above
Proposed resolution
Exit early if $menu is empty
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None