- Issue created by @sboden
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
I think the change to default arguments to ::toUrl may have been the issue
It broke aggregator module too
The problem is with a change in functionality of calling a canonical view when the "Link label to the referenced entity" is switched on. In Drupal 10.1.x when an element does not have a canonical view Drupal "skips" requesting it, while in Drupal 10.2.x you get a WSOD when the canonical view/route is called.
For this I would propose not to show the "Link label to the referenced entity" for an element that does not have a canonical view. This would avoid Drupal calling something which does not exist. Example for this are the "From state"/"To state" fields from the contrib workflow module.
- π¬π§United Kingdom longwave UK
We could at least silently catch the exception in Views to avoid breaking things entirely.
Is there a core module that can be used to write a test for this?
- π³π±Netherlands Lendude Amsterdam
This checkbox comes from \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceLabelFormatter, Views just reuses the field formatter, so not sure if this is something Views should be handling or the FieldFormatter itself.
@larowlan is π Fall back to 'edit-form' as default $rel in EntityBase::toUrl() Fixed the change you are referring to? The formatter seems to catch the new exception thrown there so not sure.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Yeah that's the one that broke aggregator
- π¬π§United Kingdom longwave UK
Just run into this with search_api_saved_searches and the SavedSearchType entity. Changing to a bug report, because this broke a view that worked in 10.1 but not in 10.2.
The problem is that the entity declares the canonical and edit-form templates to be the same:
* links = { * "canonical" = "/admin/config/search/search-api-saved-searches/type/{search_api_saved_search_type}/edit", * "add-form" = "/admin/config/search/search-api-saved-searches/add-type", * "edit-form" = "/admin/config/search/search-api-saved-searches/type/{search_api_saved_search_type}/edit",
then this code makes an assumption about the route name:
if (isset($link_templates[$rel])) { $route_parameters = $this->urlRouteParameters($rel); $route_name = "entity.{$this->entityTypeId}." . str_replace(['-', 'drupal:'], ['_', ''], $rel); $uri = new Url($route_name, $route_parameters); }
However the
entity.search_api_saved_search_type.canonical
route does not actually exist - it shouldn't need to because theentity.search_api_saved_search_type.edit_form
route does exist.Perhaps the whole block in EntityBase::toUrl() needs reworking to ensure that the route that it selects does actually exist; if the canonical route doesn't exist it could fall back to the edit-form route instead?
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Related too π Route "entity.workbench_email_template.canonical" does not exist Needs work