diff --git a/modules/oe_whitelabel_search/src/Form/SearchForm.php b/modules/oe_whitelabel_search/src/Form/SearchForm.php index 26b0edbbb38ffb11a9ee103ac54bc968d49d79f3..a134b5f8e7214e34ca76d12893a1a6357d18c9dd 100644 --- a/modules/oe_whitelabel_search/src/Form/SearchForm.php +++ b/modules/oe_whitelabel_search/src/Form/SearchForm.php @@ -48,6 +48,11 @@ 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); $form['#region'] = $config['form']['region']; @@ -60,7 +65,7 @@ class SearchForm extends FormBase { '#margin_class' => 'mb-0', '#form_id' => $this->getFormId(), '#region' => $config['form']['region'], - '#default_value' => $config['input']['name'], + '#default_value' => $input_value, '#required' => TRUE, ];