From 25c81b6039fa9eb63467d968a81b6e3efee2d548 Mon Sep 17 00:00:00 2001 From: Carson Oldson Date: Wed, 30 Oct 2024 10:42:05 -0500 Subject: [PATCH] [EPAD8-2651] Resolving bug where some Web Area content was not displaying the breadcrumbs. --- .../src/GroupMenuBasedBreadcrumbBuilder.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/drupal/web/modules/custom/epa_breadcrumbs/src/GroupMenuBasedBreadcrumbBuilder.php b/services/drupal/web/modules/custom/epa_breadcrumbs/src/GroupMenuBasedBreadcrumbBuilder.php index 1d7518a3b..ca0c1b904 100644 --- a/services/drupal/web/modules/custom/epa_breadcrumbs/src/GroupMenuBasedBreadcrumbBuilder.php +++ b/services/drupal/web/modules/custom/epa_breadcrumbs/src/GroupMenuBasedBreadcrumbBuilder.php @@ -203,9 +203,12 @@ public function applies(RouteMatchInterface $route_match) { } $group = $group_content->getGroup(); - $menus = group_content_menu_get_menus_per_group($group); - $menu = reset($menus); - $menu_id = GroupContentMenuInterface::MENU_PREFIX . $menu->id(); + $gc_menus = group_content_menu_get_menus_per_group($group); + $gc_menu = reset($gc_menus); + // The object loaded is a group content object. The actual menu is what's returned from the getEntity() call. + // For unknown reasons (presumably an artifact of the migration) the loaded $gc_menu object's ID is different than the menu ID which does work for a majority of web areas. + // This change should always work as we're always going to get the correct entity ID now. + $menu_id = GroupContentMenuInterface::MENU_PREFIX . $gc_menu->getEntity()->id(); if ($menu_id) { $this->menuTrail = [];