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
Issue fork notificationswidget-3498389
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
Comment #2
nidhish commentedComment #4
nidhish commentedComment #5
nidhish commentedComment #7
bramdriesenComment #9
bramdriesen