else { // On the views.ajax route, set the action to the page we were on.
$form_action = Url::
fromUserInput($this->currentPathStack->
getPath())->
toString();
} } else { $form_action =
$view->
getUrl()->
toString();
} $form['#action'
] =
$form_action;
$form['#theme'
] =
$view->
buildThemeFunctions('views_exposed_form'
);
$form['#id'
] = Html::
cleanCssIdentifier('views_exposed_form-' .
$view->storage->
id() . '-' .
$display['id'
]);
// Labels are built too late for inline form errors to work, resulting
// in duplicated messages.
$form['#disable_inline_form_errors'
] = TRUE;
/** @var \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface $exposed_form_plugin */
$exposed_form_plugin =
$view->display_handler->
getPlugin('exposed_form'
);
$exposed_form_plugin->
exposedFormAlter($form,
$form_state);
// Save the form.
$this->exposedFormCache->
setForm($view->storage->
id(),
$view->current_display,
$form);