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

Issue fork facets-3291943

Command icon 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

abhaisasidharan created an issue. See original summary.

mkalkbrenner’s picture

Version: 2.0.2 » 2.0.x-dev
Status: Active » Needs review
Issue tags: -Facet API, -url
StatusFileSize
new8.82 KB

I discovered another edge case if the facet source is a block display.
Here's a patch.

Status: Needs review » Needs work

The last submitted patch, 3: 3291943.patch, failed testing. View results

mkalkbrenner’s picture

Status: Needs work » Needs review
StatusFileSize
new11.63 KB

fixed tests?

Status: Needs review » Needs work

The last submitted patch, 5: 3291943-5.patch, failed testing. View results

mkalkbrenner’s picture

Status: Needs work » Needs review
StatusFileSize
new21.38 KB

  • mkalkbrenner committed 313c10b on 2.0.x
    Issue #3291943 by mkalkbrenner, abhaisasidharan: When rendering facets...
mkalkbrenner’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

berdir’s picture