public function buildForm(array
$form, FormStateInterface
$form_state) { // Don't show the form when batch operations are in progress.
if ($batch =
batch_get() &&
isset($batch['current_set'
])) { return [ // Set the theme callback to be nothing to avoid errors in template_preprocess_views_exposed_form().
'#theme' => '',
];
} // Make sure that we validate because this form might be submitted
// multiple times per page.
$form_state->
setValidationEnforced();
/** @var \Drupal\views\ViewExecutable $view */
$view =
$form_state->
get('view'
);
$display = &
$form_state->
get('display'
);
$form_state->
setUserInput($view->
getExposedInput());
// Let form plugins know this is for exposed widgets.
$form_state->
set('exposed', TRUE
);
// Check if the form was already created
if ($cache =
$this->exposedFormCache->
getForm($view->storage->
id(),
$view->current_display
)) { return $cache;
}