- 🇺🇸United States alison
I found this issue right after submitting a new one, darn.
🐛 On views with AJAX enabled, exposed filter "reset" causes page load ActiveI'm not closing my new one quite yet, though, for a few reasons (in no particular order):
- I think the fact that the reset button causes a page load when AJAX is enabled is the root cause of the issue -- I think even on a view page display, hitting Reset shouldn't cause a page load, right?
- When I reproduce the issue, the form action is the view page display URL from the start, not just after I submit filters.
- I think my steps to reproduce are simpler? (but if folks agree and if the issue I created is closed as a duplicate, I could easily copy those steps to reproduce into here).
- last update
almost 2 years ago Build Successful - last update
almost 2 years ago Composer error. Unable to continue. - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
As noted in #23, the problem seems to be that
::getLinkDisplay()
chooses the first display that has a path. Why would it ever make sense to do this? This will often give the path of a different display and I don't see how that would ever be correct.This was fixed in
views_block_filter_block
by removing the loop that searches other displays; see #2979690: Incorrect form action URL for views that have page displays → . - 🇮🇪Ireland marksmith
This is still an issue in Drupal 11.1 and it can become quite annoying for blocks with exposed filters (I use page reload, arguments, query parameters, and contextual filters in my block, no AJAX).
When the first views display item with path (page, rss, etc.) in the current view is a view with a dynamic route (like node/%node/somepage), this also leads to a routing error, like this one:
Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("node") to generate a URL for route "view.viewname.page_1". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 180 of /var/www/html/mysite/web/core/lib/Drupal/Core/Routing/UrlGenerator.php).
The root cause of the issue was described by #23 (for Drupal 9) and reinforced in #38, and a workaround was suggested in #30.
One small addition though that might help others. By default it's the first path within the current view which is chosen by the block. However, in the Pager > Link display section you can choose other displays with a path from the current (!) view as well. Only the "None" and "Custom URL" options of the Link display are not respected. (And ultimately the default None option is not respected by getLinkDisplay). So I created a random page (with the /node path), disabled it, and use this as a reference link for the block with the exposed filters.
- 🇦🇺Australia acbramley
This is probably a duplicate of 🐛 Problem with action path for embedded forms Needs work - there's a WIP MR up over there but as per comment 75 BC is going to be tricky for this fix.
- First commit to issue fork.