From 68ccfee947dc8d9adddb8c472c577ef5a8c9a2ec Mon Sep 17 00:00:00 2001
From: Eric Bremner <ebremner@uwaterloo.ca>
Date: Wed, 13 Apr 2022 10:25:02 -0400
Subject: [PATCH] ISTWCMS-4729: fixing undefined variable error in site search
 form

---
 src/Form/UwSearchForm.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Form/UwSearchForm.php b/src/Form/UwSearchForm.php
index 812bf626..2ad1a2a3 100644
--- a/src/Form/UwSearchForm.php
+++ b/src/Form/UwSearchForm.php
@@ -94,6 +94,9 @@ class UwSearchForm extends FormBase {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
 
+    // Variable for the parameters.
+    $parameters = '';
+
     // Get the values from the form state.
     $values = $form_state->getValues();
 
@@ -101,9 +104,6 @@ class UwSearchForm extends FormBase {
     // set for the redirect to the search.
     if ($values['search-input'] || $values['search-type']) {
 
-      // Variable for the parameters.
-      $parameters = '';
-
       // If this is a site search, add it to parameters.
       if ($values['search-type']) {
         $parameters .= $values['search-type'] . ' ';
-- 
GitLab