From aecaa88a4ecefcbe97addb513f48110e5599d0cc Mon Sep 17 00:00:00 2001
From: escuriola <escuriola@gmail.com>
Date: Wed, 18 May 2022 18:24:05 +0200
Subject: [PATCH] OEL-1367: As input_name is required is not needed the if
 wrapper.

---
 modules/oe_whitelabel_search/src/Form/SearchForm.php | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/modules/oe_whitelabel_search/src/Form/SearchForm.php b/modules/oe_whitelabel_search/src/Form/SearchForm.php
index 833a25de..01dd3444 100644
--- a/modules/oe_whitelabel_search/src/Form/SearchForm.php
+++ b/modules/oe_whitelabel_search/src/Form/SearchForm.php
@@ -48,10 +48,6 @@ class SearchForm extends FormBase {
     if (empty($config['input']['name'])) {
       return [];
     }
-    $input_value = '';
-    if (!empty($config['input']['name'])) {
-      $input_value = $this->getRequest()->get($config['input']['name']);
-    }
 
     $form_state->set('oe_whitelabel_search_config', $config);
 
@@ -65,7 +61,7 @@ class SearchForm extends FormBase {
       '#margin_class' => 'mb-0',
       '#form_id' => $this->getFormId(),
       '#region' => $config['form']['region'],
-      '#default_value' => $input_value,
+      '#default_value' => $this->getRequest()->get($config['input']['name']),
       '#required' => TRUE,
       '#attributes' => [
         'placeholder' => $config['input']['placeholder'],
-- 
GitLab