I get this php fatal error when I select links in better expose filter setting in view for expose filter.

"Error: Call to undefined method Drupal\views\Plugin\views\display\Block::getUrlInfo() in Drupal\better_exposed_filters\Plugin\views\exposed_form\BetterExposedFilters->exposedFormAlter() (line 964 of modules/contrib/better_exposed_filters/src/Plugin/views/exposed_form/BetterExposedFilters.php). "

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pallavi_sugandhi created an issue. See original summary.

mikeohara’s picture

+1 for this issue.

I am getting this when using BEF to render a category field filter as links.

mikeohara’s picture

Followup: This issue is only present when using a view as a block with BEF. If the same view uses a page, the view works fine.

bkhandruk’s picture

Did some digging into Drupal core and found out that there is no available getUrlInfo() method for objects of class \Drupal\views\Plugin\views\display\Block. But there is getUrl() method that we can use for these objects instead.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

+1 This looks perfect

vodde83’s picture

The patch does resolve the issue.
However, when I use a View with only a Block display + BEF, I get "You cannot create a URL to a display without routes.".
Which makes sense, as there's no Page display to derive an path from.

For now, I use Url::fromRoute('<current>') in that situation, but maybe not the best solution

Daniel Korte’s picture

Status: Reviewed & tested by the community » Needs work

I agree with vodde83 that the patch in #4 does not resolve the issue. I get the same error: "You cannot create a URL to a display without routes."

I'm changing the status to Needs Work.

Algeron’s picture

tim_dj’s picture

It also fails with me while using an embedded view

Roland Brand’s picture

+1
I am also getting this error with a block view and a filter over a term reference field.

Neslee Canil Pinto’s picture

Status: Needs work » Closed (won't fix)

We are trying to deprecate 8.x-3.x, can you please check whether this still exists in 8.x-4.x/8.x-5.x branch.