From 26a4ca66efddb7ba69436cec79981c9d9a14abbb Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 2 Sep 2020 09:41:59 +0100 Subject: [PATCH] Return early for admin routes --- .../custom/simple_message/src/DisplaySimpleMessage.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/modules/custom/simple_message/src/DisplaySimpleMessage.php b/web/modules/custom/simple_message/src/DisplaySimpleMessage.php index 8abcd47..7e49389 100644 --- a/web/modules/custom/simple_message/src/DisplaySimpleMessage.php +++ b/web/modules/custom/simple_message/src/DisplaySimpleMessage.php @@ -24,6 +24,10 @@ class DisplaySimpleMessage implements EventSubscriberInterface { } public function displayMessage(GetResponseEvent $event) { + if (\Drupal::service('router.admin_context')->isAdminRoute()) { + return; + } + $this->messenger->addMessage($this->t('This site is running on a Vagrant server, deployed with Ansible and Ansistrano.', [ '@ansible' => 'https://ansible.com', '@ansistrano' => 'https://ansistrano.com',