'#options' =>
$options,
'#default_value' =>
$this->options
['fields'
],
];
} else { $form_state->
setErrorByName('',
$this->
t('You have to add some fields to be able to use this filter.'
));
} } } public function query() { $this->view->
_build('field'
);
$fields =
[];
// Only add the fields if they have a proper field and table alias.
foreach ($this->options
['fields'
] as $id) { // Overridden fields can lead to fields missing from a display that are
// still set in the non-overridden combined filter.
if (!
isset($this->view->field
[$id])) { // If fields are no longer available that are needed to filter by, make
// sure no results are shown to prevent displaying more then intended.
$this->view->build_info
['fail'
] = TRUE;
continue;
}