Problem
Add a facet block on a non search page and check the box to show facets even when source is not rendered. It works fine but when a route does not exist or is not found it throws error instead of showing the 404 pages.
The error:
Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/sdfsdf". in Drupal\Core\Routing\Router->matchRequest() (line 124 of core/lib/Drupal/Core/Routing/Router.php).
Steps to reproduce
Add a facet block to page or render programmatically.
Make sure facet can be rendered without facet source.
Go to random non-existent page which should return 404 page not found.
You will see error.
Proposed resolution
Use Url::fromRoute(''); instead of Url::createFromRequest($request); to get current url object.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3291943-7.patch | 21.38 KB | mkalkbrenner |
| #5 | 3291943-5.patch | 11.63 KB | mkalkbrenner |
| #3 | 3291943.patch | 8.82 KB | mkalkbrenner |
Issue fork facets-3291943
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mkalkbrennerI discovered another edge case if the facet source is a block display.
Here's a patch.
Comment #5
mkalkbrennerfixed tests?
Comment #7
mkalkbrennerComment #9
mkalkbrennerComment #11
berdirThis seems to have caused a regression: #3313850: All facet options marked as active when showing reset all option