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
Comment #2
jurgenhaasThis is a duplicate of #3610934: Fatal error on edit forms of entities without bundle configuration entity (but a bundle key)