Problem
We get a Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.facets_summary.canonical" does not exist
error when we try to import config after upgrade from Drupal 8.4.3 to 8.4.4.
We identified the links annotation of the \Drupal\facets_summary\Entity\FacetsSummary
class as the source of the problem:
* links = {
* "canonical" = "/admin/config/search/facets",
* "add-form" = "/admin/config/search/facets/add-facet-summary",
* "edit-form" = "/admin/config/search/facets/facet-summary/{facets_summary}/edit",
* "settings-form" = "/admin/config/search/facets/facet-summary{facets_summary}/settings",
* "delete-form" = "/admin/config/search/facets/facet-summary/{facets_summary}/delete",
* }
There is no `facets_summary.canonical` path in the router.
And a canonical link should point to "/admin/config/search/facets/facet-summary/{facets_summary}" as in the \Drupal\node\Entity
entity:
* links = {
* "canonical" = "/node/{node}",
* "delete-form" = "/node/{node}/delete",
* "edit-form" = "/node/{node}/edit",
* "version-history" = "/node/{node}/revisions",
* "revision" = "/node/{node}/revisions/{node_revision}/view",
* "create" = "/node",
Proposed resolution
There are 2 options to fix the issue:
1. Remove the canonical
link from the links.
2. Change the canonical
link to a collection
link.
Remaining tasks
Create patch (or update code) to remove or change the canonical link.
Comment | File | Size | Author |
---|---|---|---|
#5 | removed-wrong-link-from-facets-summary-entity-2936781-1.patch | 695 bytes | zero2one |
Comments
Comment #2
zero2one CreditAttribution: zero2one at Serial Graphics commentedComment #3
zero2one CreditAttribution: zero2one at Serial Graphics commentedComment #4
borisson_I'm not sure if just removing the link will lead to other issues, but if we can, we should totally do that.
Comment #5
zero2one CreditAttribution: zero2one at Serial Graphics commentedThis is the patch to remove the wrong link from the FacetSummary entity.
Comment #6
mpp CreditAttribution: mpp as a volunteer and at AmeXio commentedHave a look at the API documentation here: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...
Comment #7
borisson_Let's see how the testbot feels about that.
Comment #8
borisson_Committed and pushed, thanks so much for helping here.
Comment #10
idebr CreditAttribution: idebr at ezCompany commentedAdding the exact error message for search engines:
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.facets_summary.canonical" does not exist
Comment #12
zlatev CreditAttribution: zlatev commentedHi,
I'm upgrading from 8.2.x to 8.4.x and the only way to bypass the error above was to change canonical into collection as the patch above didn't worked out.