Problem/Motivation

On Drupal 11.4.4, the default_admin theme causes a fatal error when viewing the translation overview for a custom menu link.

Drupal\default_admin\Hook\PreprocessHooks::preprocessBreadcrumb() assumes the entity bundle resolves to an entity and calls label() on it. For menu_link_content, $entity->get('bundle')->entity is NULL.

Full error stack available.

Switching back to Claro resolves the problem.

## Steps to reproduce

1. Install Drupal 11.4.4.
2. Use default_admin as the administration theme.
3. Enable content translation for custom menu links.
4. Create a custom menu link.
5. Visit /admin/structure/menu/item/{menu_link_content}/edit/translations.

Expected result

The translation overview is displayed.

Actual result

Fatal error:

Error: Call to a member function label() on null in Drupal\default_admin\Hook\PreprocessHooks->preprocessBreadcrumb()

Proposed resolution

Only use the bundle entity label when the bundle entity exists; otherwise retain the entity type singular label.

Comments

xmacinfo created an issue. See original summary.

jurgenhaas’s picture

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.