Commit d554c78f authored by Mike Keran's avatar Mike Keran
Browse files

Issue #2859094 by wouters_f, jover: Exposed filters block not showing on block view

parent 87853c36
......@@ -739,7 +739,7 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
// the view results appear on. This can cause problems with
// select_as_links options as they will use the wrong path. We
// provide a hint for theme functions to correct this.
$form['sort_bef_combine']['#bef_path'] = $this->displayHandler->getUrl();
$form['sort_bef_combine']['#bef_path'] = $this->getExposedFormActionUrl();
break;
case 'default':
......@@ -785,9 +785,9 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
// view results appear on. This can cause problems with
// select_as_links options as they will use the wrong path. We provide
// a hint for theme functions to correct this.
$form['sort_by']['#bef_path'] = $this->displayHandler->getUrl();
$form['sort_by']['#bef_path'] = $this->getExposedFormActionUrl();
if(!empty($form['sort_order'])) {
$form['sort_order']['#bef_path'] = $this->displayHandler->getUrl();
$form['sort_order']['#bef_path'] = $this->getExposedFormActionUrl();
}
}
......@@ -854,7 +854,7 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
// the view results appear on. This can cause problems with
// select_as_links options as they will use the wrong path. We
// provide a hint for theme functions to correct this.
$form['items_per_page']['#bef_path'] = $this->displayHandler->getUrl();
$form['items_per_page']['#bef_path'] = $this->getExposedFormActionUrl();
}
break;
}
......@@ -1102,7 +1102,7 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
// the view results appear on. This can cause problems with
// select_as_links options as they will use the wrong path. We provide
// a hint for theme functions to correct this.
$form[$field_id]['#bef_path'] = $this->displayHandler->getUrl();
$form[$field_id]['#bef_path'] = $this->getExposedFormActionUrl();
break;
case 'bef_single':
......@@ -1563,4 +1563,22 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
return $settings;
}
/**
* Returns exposed form action URL object.
*
* @return \Drupal\Core\Url
* Url object.
*/
protected function getExposedFormActionUrl() {
if ($this->displayHandler->getRoutedDisplay()) {
return $this->displayHandler->getUrl();
}
$request = \Drupal::request();
$url = Url::createFromRequest($request);
$url->setAbsolute();
return $url;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment