diff --git a/web/themes/contrib/civictheme/includes/local_tasks.inc b/web/themes/contrib/civictheme/includes/local_tasks.inc index a77631631..04c713729 100644 --- a/web/themes/contrib/civictheme/includes/local_tasks.inc +++ b/web/themes/contrib/civictheme/includes/local_tasks.inc @@ -8,6 +8,7 @@ declare(strict_types=1); use Drupal\civictheme\CivicthemeConstants; +use Drupal\Core\Access\AccessResultInterface; /** * Pre-process for local tasks. @@ -19,14 +20,14 @@ function _civictheme_preprocess_menu_local_tasks(array &$variables): void { foreach ($local_task_types as $local_task_type) { $variables['links'][$local_task_type] = []; foreach ($variables[$local_task_type] as $link) { - if (!empty($link['#access']) && $link['#access']->isAllowed()) { + if (!empty($link['#access']) && ($link['#access'] === TRUE || ($link['#access'] instanceof AccessResultInterface && $link['#access']->isAllowed()))) { $variables['links'][$local_task_type][] = [ 'theme' => $context_theme, 'text' => $link['#link']['title'], 'url' => $link['#link']['url']->toString(), 'is_new_window' => FALSE, 'is_external' => $link['#link']['url']->isExternal(), - 'modifier_class' => $link['#active'] ? 'ct-tabs__tab--selected selected' : '', + 'modifier_class' => !empty($link['#active']) && $link['#active'] === TRUE ? 'ct-tabs__tab--selected selected' : '', 'weight' => $link['#weight'] ?? 0, ]; }