Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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). "
Comment | File | Size | Author |
---|---|---|---|
#4 | better_exposed_filters-error_call_to_undefined_method_geturlinfo-2756885-4.patch | 719 bytes | bkhandruk |
Comments
Comment #2
mikeohara+1 for this issue.
I am getting this when using BEF to render a category field filter as links.
Comment #3
mikeoharaFollowup: 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.
Comment #4
bkhandruk CreditAttribution: bkhandruk commentedDid 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.
Comment #5
dawehner+1 This looks perfect
Comment #6
vodde83 CreditAttribution: vodde83 commentedThe 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 solutionComment #7
Daniel KorteI 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.
Comment #8
Algeron CreditAttribution: Algeron at XIO commentedSeems related to #2776615: Exposed filters break on blocks with AJAX filters
Comment #9
tim_djIt also fails with me while using an embedded view
Comment #10
Roland Brand CreditAttribution: Roland Brand commented+1
I am also getting this error with a block view and a filter over a term reference field.
Comment #11
Neslee Canil PintoWe 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.