From 792f70c3084c97a7dc73a405a7a55c80616f4651 Mon Sep 17 00:00:00 2001
From: Kevin Paxman <kpaxman@uwaterloo.ca>
Date: Thu, 16 Mar 2023 18:49:57 -0400
Subject: [PATCH] ISTWCMS-5879: fix issue where dashboard settings weren't
 reing reflected, by only setting a default if there isn't already one

---
 uw_cfg_common.module | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/uw_cfg_common.module b/uw_cfg_common.module
index c7bbd649..d2329d3c 100644
--- a/uw_cfg_common.module
+++ b/uw_cfg_common.module
@@ -246,17 +246,25 @@ function uw_cfg_common_form_layout_builder_configure_section_alter(array &$form,
   // Column separator group should not appear one column.
   if (isset($form['layout_builder_style_column_separator'])) {
     // Ensuring that none is selected for column separator by default.
-    $form['layout_builder_style_column_separator']['#default_value'] = 'uw_lbs_column_separator_none';
+    if (!isset($form['layout_builder_style_column_separator']['#default_value'])) {
+      $form['layout_builder_style_column_separator']['#default_value'] = 'uw_lbs_column_separator_none';
+    }
   }
 
   // Ensuring that none is selected for section separator by default.
-  $form['layout_builder_style_section_separator']['#default_value'] = 'uw_lbs_section_separator_none';
+  if (!isset($form['layout_builder_style_section_separator']['#default_value'])) {
+    $form['layout_builder_style_section_separator']['#default_value'] = 'uw_lbs_section_separator_none';
+  }
 
   // Ensuring that default is selected for section spacing by default.
-  $form['layout_builder_style_section_spacing']['#default_value'] = 'uw_lbs_section_spacing_default';
+  if (!isset($form['layout_builder_style_section_spacing']['#default_value'])) {
+    $form['layout_builder_style_section_spacing']['#default_value'] = 'uw_lbs_section_spacing_default';
+  }
 
   // Ensuring that the contained width is selected by default.
-  $form['layout_builder_style_default']['#default_value'] = 'uw_lbs_contained_width';
+  if (!isset($form['layout_builder_style_default']['#default_value'])) {
+    $form['layout_builder_style_default']['#default_value'] = 'uw_lbs_contained_width';
+  }
 }
 
 /**
-- 
GitLab