Remove canonical link template in EntityBrowser entity annotation because it has no canonical route

Created on 21 December 2023, 9 months ago
Updated 28 July 2024, about 2 months ago

Problem/Motivation

The config entity EntityBrowser has a "canonical" link template declared but it has no canonical route defined. On Drupal 10.2.0 this breaks if you have another module that checks if entities have a canonical link template and tries to generate the canonical URL (based on route).

This will error out with " Route "entity.entity_browser.canonical" does not exist"

More error stack trace:

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.entity_browser.canonical" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 of core/lib/Drupal/Core/Routing/RouteProvider.php).
Drupal\Core\Routing\UrlGenerator->getRoute('entity.entity_browser.canonical') (Line: 276)
Drupal\Core\Routing\UrlGenerator->generateFromRoute('entity.entity_browser.canonical', Array, Array, 1) (Line: 108)
Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute('entity.entity_browser.canonical', Array, Array, ) (Line: 765)
Drupal\Core\Url->toString() (Line: 109)
Drupal\responsive_preview\ResponsivePreview->getPreviewUrl() (Line: 327)
Drupal\responsive_preview\ResponsivePreview->previewToolbar() (Line: 33)
responsive_preview_toolbar()
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'responsive_preview') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('toolbar', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('toolbar') (Line: 78)
Drupal\toolbar\Element\Toolbar::preRenderToolbar(Array)

Steps to reproduce

  1. Install Drupal 10.2.0
  2. Install module entity_browser 8.x-2.10
  3. Install module responsive_preview 2.1.1
  4. Create an entity browser and try to edit it

Proposed resolution

Remove the link template "canonical" in the EntityBrowser entity.

Remaining tasks

/

User interface changes

/

API changes

/

Data model changes

/

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Core API

Created by

πŸ‡§πŸ‡ͺBelgium Stefdewa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024