Issue #3230681 by andregp, hmendes, narendra.rajwar27, Chi, jobsons, catch, Eugene Bocharov, alexpott: ViewsExposedFilterBlock::build must always return array

merge-requests/828/head^2
Alex Pott 2022-09-27 15:53:55 +01:00
parent 3098069a88
commit 80e342faaf
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
1 changed files with 2 additions and 2 deletions

View File

@ -32,12 +32,12 @@ class ViewsExposedFilterBlock extends ViewsBlockBase {
* context of current view and display ID.
*/
public function build() {
$output = $this->view->display_handler->viewExposedFormBlocks();
$output = $this->view->display_handler->viewExposedFormBlocks() ?? [];
// Provide the context for block build and block view alter hooks.
// \Drupal\views\Plugin\Block\ViewsBlock::build() adds the same context in
// \Drupal\views\ViewExecutable::buildRenderable() using
// \Drupal\views\Plugin\views\display\DisplayPluginBase::buildRenderable().
if (is_array($output) && !empty($output)) {
if (!empty($output)) {
$output += [
'#view' => $this->view,
'#display_id' => $this->displayID,