From b04a25eee83d1bbff575b41d4c6e88ded939806f Mon Sep 17 00:00:00 2001 From: Timur Tripp Date: Wed, 21 Feb 2024 14:27:33 -0700 Subject: [PATCH] CuBoulder/ucb_site_configuration#50 Prevents third-party services from being attached to admin pages --- ucb_site_configuration.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucb_site_configuration.module b/ucb_site_configuration.module index 5f83caf..fda6fa6 100644 --- a/ucb_site_configuration.module +++ b/ucb_site_configuration.module @@ -29,7 +29,7 @@ function ucb_site_configuration_preprocess_page(array &$variables) { function ucb_site_configuration_page_attachments(array &$variables) { /** @var \Drupal\ucb_site_configuration\SiteConfiguration */ $service = \Drupal::service('ucb_site_configuration'); - if (($node = \Drupal::routeMatch()->getParameter('node')) && $node instanceof NodeInterface) { + if (!\Drupal::service('router.admin_context')->isAdminRoute() && ($node = \Drupal::routeMatch()->getParameter('node')) && $node instanceof NodeInterface) { $service->attachExternalServiceIncludes($variables, $node); } }