From 10040d5b93a18190a97ea12a9f076703c639d314 Mon Sep 17 00:00:00 2001
From: brooke_heaton <brooke_heaton@402231.no-reply.drupal.org>
Date: Fri, 22 May 2020 13:15:02 -0500
Subject: [PATCH] Issue #3136067 by brooke_heaton: Undefined index: type in
 bootstrap_barrio_preprocess_form_element()

---
 bootstrap_barrio.theme | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/bootstrap_barrio.theme b/bootstrap_barrio.theme
index d65af0b..52c4b04 100644
--- a/bootstrap_barrio.theme
+++ b/bootstrap_barrio.theme
@@ -385,17 +385,19 @@ function bootstrap_barrio_preprocess_form_element(&$variables) {
   if (isset($variables['element']['#attributes'])) {
     $variables['input_attributes'] = new Attribute($variables['element']['#attributes']);
   }
-  switch ($variables['type']) {
-    case 'checkbox':
-      $variables['customtype'] = theme_get_setting('bootstrap_barrio_checkbox');
-      break;
+  if (isset($variables['type'])) {
+    switch ($variables['type']) {
+      case 'checkbox':
+        $variables['customtype'] = theme_get_setting('bootstrap_barrio_checkbox');
+        break;
 
-    case 'radio':
-      $variables['customtype'] = theme_get_setting('bootstrap_barrio_radio');
-      break;
+      case 'radio':
+        $variables['customtype'] = theme_get_setting('bootstrap_barrio_radio');
+        break;
 
-    default:
-      break;
+      default:
+        break;
+    }
   }
 }
 
-- 
GitLab