Problem/Motivation

Got error page when edit menu item with default_admin theme:

The website encountered an unexpected error. Try again later.

Error: Call to a member function label() on null in Drupal\default_admin\Hook\PreprocessHooks->preprocessBreadcrumb() (line 192 of core/themes/default_admin/src/Hook/PreprocessHooks.php).
Drupal\Core\Theme\ThemeManager->invoke() (Line: 311)
Drupal\Core\Theme\ThemeManager->{closure:Drupal\Core\Theme\ThemeManager::render():293}() (Line: 340)
Drupal\Core\Theme\ThemeManager->render() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 230)
Drupal\Core\Render\Renderer->render() (Line: 1309)
Drupal\default_admin\Hook\PreprocessHooks->preprocessTopBar() (Line: 523)
Drupal\Core\Theme\ThemeManager->invoke() (Line: 311)
Drupal\Core\Theme\ThemeManager->{closure:Drupal\Core\Theme\ThemeManager::render():293}() (Line: 340)
Drupal\Core\Theme\ThemeManager->render() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 253)
Drupal\Core\Render\Renderer->doRenderRoot() (Line: 143)
Drupal\Core\Render\Renderer->{closure:Drupal\Core\Render\Renderer::renderInIsolation():142}() (Line: 638)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():638}()
Fiber->resume() (Line: 653)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 142)
Drupal\Core\Render\Renderer->renderInIsolation() (Line: 169)
Drupal\Core\Render\Renderer->doRenderPlaceholder() (Line: 764)
Drupal\Core\Render\Renderer->{closure:Drupal\Core\Render\Renderer::replacePlaceholders():763}()
Fiber->resume() (Line: 775)
Drupal\Core\Render\Renderer->replacePlaceholders() (Line: 265)
Drupal\Core\Render\Renderer->doRenderRoot() (Line: 143)
Drupal\Core\Render\Renderer->{closure:Drupal\Core\Render\Renderer::renderInIsolation():142}() (Line: 638)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():638}()
Fiber->start() (Line: 639)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 142)
Drupal\Core\Render\Renderer->renderInIsolation() (Line: 113)
Drupal\Core\Render\Renderer->renderRoot() (Line: 260)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->renderPlaceholders() (Line: 58)
Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor->processAttachments() (Line: 45)
Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond() (Line: 246)
Symfony\Component\EventDispatcher\EventDispatcher::{closure:Symfony\Component\EventDispatcher\EventDispatcher::optimizeListeners():241}() (Line: 206)
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 216)
Symfony\Component\HttpKernel\HttpKernel->filterResponse() (Line: 204)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 30)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 118)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 92)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 61)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 753)
Drupal\Core\DrupalKernel->handle() (Line: 34)
Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (Line: 32)
require('/var/www/html/vendor/autoload_runtime.php') (Line: 22)
require_once('/var/www/html/web/autoload_runtime.php') (Line: 13)

Issue fork drupal-3613636

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ipumpkin created an issue. See original summary.

ipumpkin’s picture

Status: Active » Needs review
jurgenhaas’s picture

Status: Needs review » Active

Thank you @ipumpkin for reporting this. Your MR actually prevents that issue from happening, but I'm not sure it's the right way forward. MenuLinkContent does not support bundles, but still it defines the entity key bundle. This feels like the underlying issue.

We should find out first why that entity type has that bundle key.

ipumpkin’s picture

@jurgenhaas thanks for your reply. You are right, we need to go further and address the root cause.

jurgenhaas’s picture

Title: default_admin theme error when edit menu item » MenuLinkContent should not define the bundle entity key
Version: 11.4.x-dev » main
Component: Admin theme » menu_link_content.module
jurgenhaas’s picture

rodrigoaguilera’s picture

Status: Active » Closed (duplicate)

There is an older issue with the exact same purpose
#2987537: Custom menu link entity type should not declare "bundle" entity key

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rodrigoaguilera’s picture