Disabled overrides should not cause conflicts

Created on 6 August 2023, over 1 year ago
Updated 21 September 2023, about 1 year ago

Problem/Motivation

Started in this comment: https://www.drupal.org/project/symfony_mailer/issues/3366091#comment-151... 🐛 Wrong email builder chosen Needs review

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

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom adamps

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

Comments & Activities

  • Issue created by @adamps
  • 🇬🇧United Kingdom adamps

    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.

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    6 pass
    • AdamPS committed ebbea0f1 on 1.x
      Issue #3379529 by AdamPS: Disabled overrides should not cause conflicts
      
  • Status changed to Fixed about 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024