Cannot generate default URL ajax issue when emails are configured and using reroute email

Created on 27 April 2024, about 2 months ago
Updated 17 May 2024, about 1 month ago

Problem/Motivation

When I have moderation_note configured to send emails and reroute_email β†’ . I get a 500 error when trying to save a note. If I disable the note's email configuration and try to save the note again, it works.

"
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /moderation-note/add/node/58/body/en/full?_wrapper_format=drupal_dialog.off_canvas&ajax_form=1
StatusText: error
ResponseText: The website encountered an unexpected error. Try again later.Drupal\Core\Entity\EntityStorageException: Cannot generate default URL because no link template 'canonical' or 'edit-form' was found for the 'moderation_note' entity type in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php). moderation_note_mail('insert', Array, Array)
call_user_func_array(Object, Array) (Line: 400)
Drupal\Core\Extension\ModuleHandler->invoke('moderation_note', 'mail', Array) (Line: 272)
Drupal\Core\Mail\MailManager->doMail('moderation_note', 'insert', '"creator" , "wvde-user-one-admin" ', 'en', Array, NULL, 1) (Line: 180)
Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 181)
Drupal\Core\Mail\MailManager->mail('moderation_note', 'insert', '"creator" , "wvde-user-one-admin" ', 'en', Array, NULL, 1) (Line: 70)
Drupal\mailsystem\MailsystemManager->mail('moderation_note', 'insert', '"creator" , "wvde-user-one-admin" ', 'en', Array) (Line: 468)
moderation_note_moderation_note_insert(Object)
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'moderation_note') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('moderation_note_insert', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('moderation_note_insert', Array) (Line: 215)
Drupal\Core\Entity\EntityStorageBase->invokeHook('insert', Object) (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('insert', Object) (Line: 564)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, ) (Line: 781)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, ) (Line: 489)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 352)
Drupal\Core\Entity\EntityBase->save() (Line: 293)
Drupal\Core\Entity\EntityForm->save(Array, Object) (Line: 262)
Drupal\moderation_note\ModerationNoteForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('moderation_note_create_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'create') (Line: 46)
Drupal\moderation_note\Controller\ModerationNoteController->createNote(Object, 'body', 'en', 'full')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
"

Steps to reproduce

1. Enable moderation_note and reroute_email
2. configure both modules, have moderation_note send emails
3. edit a revision and try to add a note
4. click save
5. confirm console error message
6. turn off emails in moderation_note
7. confirm saving note now works

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: duplicate

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States robpowell Boston

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

Comments & Activities

Production build 0.69.0 2024