i need to modify the submit function of the module custom_search (8.x-1.0-beta3).
I need to set a Cookie every time the guest user search something, how can i override or extend the submit function?
It looks like not represent a hook. The function is: custom_search_search_page_submit located in the file custom_search.module and called by the custom_search_form_alter function that implements hook_form_alter()
/**
* Search pages settings form callback.
*/
function custom_search_search_page_submit($form, \Drupal\Core\Form\FormStateInterface $form_state) {
$pageId = $form_state->getValue('id');
// Save settings, and path as well so we can use it to retrieve the correct settings later.
\Drupal::configFactory()->getEditable('custom_search.settings.results')->set($pageId . '.path', $form_state->getValue('path'))
->set($pageId . '.search', $form_state->getValue('custom_search_search'))
->set($pageId . '.advanced.visibility', $form_state->getValue('custom_search_advanced_search'))
->set($pageId . '.advanced.collapsible', $form_state->getValue('custom_search_collapsible'))
->set($pageId . '.advanced.collapsed', $form_state->getValue('custom_search_collapsed'))
->set($pageId . '.advanced.criteria', $form_state->getValue('custom_search_criteria'))
->set($pageId . '.advanced.types', $form_state->getValue('custom_search_types'))
->set($pageId . '.advanced.languages', $form_state->getValue('custom_search_languages'))
->set($pageId . '.info', $form_state->getValue('custom_search_info'))
->set($pageId . '.filter.position', $form_state->getValue('custom_search_filter_position'))
->set($pageId . '.filter.label', $form_state->getValue('custom_search_filter_label'))
->set($pageId . '.filter.any', $form_state->getValue('custom_search_filter_any'))
->save();
}