We have a custom drush command, which is doing the following:
class JobApplicationExportCommands extends DrushCommands {
/**
* Exports Dorea Job Applications since the last run to csv
*
* @command dummy:job-application-export
* @aliases duje
*/
public function drush_dummy_export () {
$applicationWebformIds = Drupal::entityQuery('webform')
->condition('category', 'Bewerbungsformulare')
->execute();
$applicationView = Views::getView('all_applications');
$applicationView->setDisplay('default');
$applicationView->setExposedInput([
'webform_ids' => array_keys($applicationWebformIds),
'submitted' => '2021-01-01'
]);
$applicationView->execute();
// now comes the unexpected part:
print_r(count($applicationView->result)); // this is wrongly 0
}
}
The view itself is configured like this (unfortunateley in german):
If I execute the same logic via a custom controller / normal request, the view does return results with this logic.
Am I missing something? Anybody knows why the exposed input of the view is ignored?