Beispiel #1
0
 /**
  * Exposed widgets typically only work with ajax in Drupal core, however
  * #2605218 totally breaks the rest of the functionality in this display and
  * in Core's Block display as well, so we allow non-ajax block views to use
  * exposed filters and manually set the #action to the current request uri.
  */
 public function elementPreRender(array $element)
 {
     /** @var \Drupal\views\ViewExecutable $view */
     $view = $element['#view'];
     if (!empty($view->exposed_widgets['#action']) && !$view->ajaxEnabled()) {
         $view->exposed_widgets['#action'] = \Drupal::request()->getRequestUri();
     }
     return parent::elementPreRender($element);
 }