renderRoot() call in SwiftMailer::format method causes Renderer logic exception when email needs to be sent via AJAX call:
LogicException: A stray renderRoot() invocation is causing bubbling of attached assets to break

Steps to reproduce:

  1. Implement form with ajax submission (I faced this problem when tried to send email on hook_comment_insert() with ajax_comments module enabled)
  2. Try to submit the form
  3. Exception will be thrown

May be it's better to replace renderRoot with renderPlain call inside SwiftMailer::format() method?

CommentFileSizeAuthor
#3 2825362_change_render_function.patch610 bytesDiDebru
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Komm created an issue. See original summary.

DiDebru’s picture

subscribe.

DiDebru’s picture

DiDebru’s picture

Version: 8.x-1.0-alpha2 » 8.x-1.x-dev
Status: Active » Needs review
StryKaizer’s picture

Issue occured here too (webform with ajax submit, rendered as a field in a paragraph, sending emails)
Patch fixed the issue, thx!

  • webflo committed 4beca5e on 8.x-1.x authored by Insasse
    Issue #2825362 by Insasse: renderRoot() call in SwiftMailer::format...
webflo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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