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

Issue fork mailsystem-3445094

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Jelle_S created an issue. See original summary.

jelle_s’s picture

Status: Active » Needs review
jelle_s’s picture

Berdir made their first commit to this issue’s fork.

  • Berdir committed 530fe725 on 8.x-4.x authored by Jelle_S
    Issue #3445094 by Jelle_S: Support mail plugin derivatives
    
berdir’s picture

Status: Needs review » Fixed

Thanks, merged.

Status: Fixed » Closed (fixed)

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