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
https://www.drupal.org/files/issues/2024-08-23/3470012-02-no_link_template.patch

Remaining tasks

User interface changes

API changes

Data model changes

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

huangweiqiu created an issue. See original summary.

nidhish’s picture

Assigned: Unassigned » nidhish

nidhish’s picture

Status: Active » Needs review
nidhish’s picture

Assigned: nidhish » Unassigned

bramdriesen made their first commit to this issue’s fork.

bramdriesen’s picture

Status: Needs review » Reviewed & tested by the community

  • bramdriesen committed f940fb32 on 2.0.x authored by nidhish
    Issue #3498389 by nidhish, bramdriesen, huangweiqiu: conflict with...
bramdriesen’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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