Support mail plugin derivatives

Created on 3 May 2024, 8 months ago
Updated 15 June 2024, 6 months ago

Problem/Motivation

The \Drupal\Core\Annotation\Mail plugins have support for derivatives, since Drupal\Core\Mail\MailManager's discovery is decorated with \Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator. However, the admin form does not take into account that usually (as is the case through all of Drupal core) the getDerivativeDefinitions() implementation of the deriver does not alter the id of the $base_plugin_definition when building its derivative definitions. Instead, the plugin_id is obtained by using the array keys of the definitions returned by the plugin manager's getDefinitions() implementation.

Steps to reproduce

Create a mail plugin with derivatives (at least two) and do not alter the id of the $base_plugin_definition when building its derivative definitions. Go to /admin/config/system/mailsystem and only one of the two derivatives will be available in the admin form.

Proposed resolution

Follow the patterns in Drupal core and use the array keys as plugin ids.

Remaining tasks

Create the MR, review it & merge it.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

4.0

Component

Module compatibility

Created by

🇧🇪Belgium jelle_s Antwerp, Belgium

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024