From de7ea13fa61d3e03a7098dc734e138a29a187416 Mon Sep 17 00:00:00 2001
From: Anuprita Kulkarni <a5kulkar@uwaterloo.ca>
Date: Mon, 29 Aug 2022 15:36:37 -0400
Subject: [PATCH] ISTWCMS-5705 Prevent webforms from being indexed removed
 redundunt code

---
 uw_cfg_common.module | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/uw_cfg_common.module b/uw_cfg_common.module
index ed65d98a..7c4575c5 100644
--- a/uw_cfg_common.module
+++ b/uw_cfg_common.module
@@ -1316,17 +1316,14 @@ function uw_cfg_common_fillpdf_form_form_pre_form_build_alter(FillPdfFormForm $f
 function uw_cfg_common_preprocess_html(&$variables): void {
   // Setting the meta tag for web forms getting indexed
   // if not used any content.
-  if (!isset($variables['node_type']) || $variables['node_type'] == NULL) {
-    if ($variables['root_path'] === 'webform') {
-      $noindex = [
-        '#tag' => 'meta',
-        '#attributes' => [
-          'name' => 'robots',
-          'content' => 'noindex',
-        ],
-      ];
-      $variables['page']['#attached']['html_head'][] = [$noindex, 'noindex'];
-    }
+  if ($variables['root_path'] === 'webform') {
+    $noindex = [
+      '#tag' => 'meta',
+      '#attributes' => [
+        'name' => 'robots',
+        'content' => 'noindex',
+      ],
+    ];
+    $variables['page']['#attached']['html_head'][] = [$noindex, 'noindex'];
   }
-
 }
-- 
GitLab