From e619e4d8cc5c87b2e7eb4919f68689b94dfd28b0 Mon Sep 17 00:00:00 2001
From: kpaxman <kpaxman@uwaterloo.ca>
Date: Wed, 19 May 2021 15:48:34 -0400
Subject: [PATCH] ISTWCMS-4874: refactor exemptions, fix comment

---
 uw_fdsu_theme_resp.theme | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/uw_fdsu_theme_resp.theme b/uw_fdsu_theme_resp.theme
index 1d6aea84..685419e2 100644
--- a/uw_fdsu_theme_resp.theme
+++ b/uw_fdsu_theme_resp.theme
@@ -99,7 +99,7 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) {
   }
 
   // ISTWCMS-4847.
-  // If we are on the main content section, the check if 404 and add
+  // If we are on the main content section, the check if not a node and add
   // appropriate classes to display proper width.
   if ($region == 'content') {
 
@@ -109,11 +109,12 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) {
     // If we are on not on a node, add appropriate classes to show
     // proper width.
     $route_name = $route_match->getRouteName();
-    if (!in_array($route_name, [
+    $exemptions = [
       'entity.node.canonical',
       'entity.node.latest_version',
       'layout_builder.overrides.node.view',
-    ])) {
+    ];
+    if (!in_array($route_name, $exemptions)) {
       $variables['classes'][] = 'layout';
       $variables['classes'][] = 'uw-contained-width';
     }
-- 
GitLab