Problem/Motivation

Started in this comment: https://www.drupal.org/project/symfony_mailer/issues/3366091#comment-151...

We just run into this issue with 1.3.0 (issue still seems to be present in 1.x too).
We have custom module named contact_form. If we try to send an email on behalf of this module, Drupal Symfony Mailer won't find a matching email builder (nor a dynamically created instance using the LegacyEmailBuilder class).

Steps to reproduce

Proposed resolution

Adjust the sequence of EmailBuilder plug-in discovery.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

AdamPS created an issue. See original summary.

adamps’s picture

Issue summary: View changes

Here are some facts about how this module works that we aren't able to change:

  1. If your module sends emails with hook_mail(), this creates an email builder with type "contact_form".
  2. If the contact module is enabled and overridden, this creates an email builder with type "contact_form".
  3. It's not supported to have two email builders with the same type.

However in your case, the contact module is disabled, so it should work. The reason it doesn't is that DefaultPluginManager::findDefinitions() first calls the alter hooks (including symfony_mailer_mailer_builder_info_alter()) and then second filters out cases where the provider doesn't exist.

adamps’s picture

Status: Active » Needs review
StatusFileSize
new8.61 KB

  • AdamPS committed ebbea0f1 on 1.x
    Issue #3379529 by AdamPS: Disabled overrides should not cause conflicts
    
adamps’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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