conflict with editor note module

Created on 9 January 2025, 15 days ago

Problem/Motivation

Message Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: Cannot generate default URL because no link template 'canonical' or 'edit-form' was found for the 'editor_note' entity type in Drupal\Core\Entity\EntityBase->toUrl() (line 211 of H:\wemp\nginx\html\nkmz\core\lib\Drupal\Core\Entity\EntityBase.php).
Severity Error
Hostname 127.0.0.1
Operations
Backtrace
#0 H:\wemp\nginx\html\nkmz\modules\contrib\notificationswidget\src\Services\NotificationsWidgetService.php(136): Drupal\Core\Entity\EntityBase->toUrl()
#1 H:\wemp\nginx\html\nkmz\modules\contrib\notificationswidget\notifications_widget.module(164): Drupal\notifications_widget\Services\NotificationsWidgetService->logNotification(Array, 'delete', Object(Drupal\editor_note\Entity\EditorNote))
#2 [internal function]: notifications_widget_entity_delete(Object(Drupal\editor_note\Entity\EditorNote))
#3 H:\wemp\nginx\html\nkmz\core\lib\Drupal\Core\Extension\ModuleHandler.php(416): call_user_func_array(Object(Closure), Array)
#4 H:\wemp\nginx\html\nkmz\core\lib\Drupal\Core\Extension\ModuleHandler.php(395): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'notifications_w...')

Steps to reproduce

Above error occurred when trying to delete a node has Editor Note field data.( https://www.drupal.org/project/editor_note

Proposed resolution

..\notificationswidget\src\Services\NotificationsWidgetService.php line 135

-   if ($entityUrl === '[entity:url]' ) {
+  if ($entityUrl === '[entity:url]' && $entity->hasLinkTemplate('canonical')) {   

references:~
https://www.drupal.org/project/media_responsive_thumbnail/issues/3470012 🐛 No link template 'canonical' found for the 'paragraph' entity type Active
https://www.drupal.org/files/issues/2024-08-23/3470012-02-no_link_template.patch 🐛 No link template 'canonical' found for the 'paragraph' entity type Active

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇨🇳China huangweiqiu

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