Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit e7b112a5 authored by escuriola's avatar escuriola
Browse files

OEL-1367: Remove non-standard button fields. Set the input name in the...

OEL-1367: Remove non-standard button fields. Set the input name in the configuration. Add a guard clause if input name is not set.
parent e7958311
No related branches found
No related tags found
2 merge requests!157OEL-1668: Update epic list pages.,!136OEL-1367: New Look & Feel for search form in search page and remove theming from block config form.
......@@ -45,13 +45,12 @@ class SearchForm extends FormBase {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, array $config = NULL): array {
if (empty($config['input']['name'])) {
return [];
}
$form_state->set('oe_whitelabel_search_config', $config);
$input_value = '';
$form['#region'] = $config['form']['region'];
if (!empty($config['input']['name'])) {
$input_value = $this->getRequest()->get($config['input']['name']);
}
$form['search_input'] = [
'#type' => 'textfield',
......@@ -61,15 +60,12 @@ class SearchForm extends FormBase {
'#margin_class' => 'mb-0',
'#form_id' => $this->getFormId(),
'#region' => $config['form']['region'],
'#default_value' => $input_value,
'#default_value' => $config['input']['name'],
'#required' => TRUE,
];
$form['submit'] = [
'#type' => 'submit',
'#input' => TRUE,
'#is_button' => TRUE,
'#executes_submit_callback' => TRUE,
'#form_id' => $this->getFormId(),
'#region' => $config['form']['region'],
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment