Problem/Motivation

Enabling the submodule for Symfony Mailer support (now Mailer Plus (DSM+)) you get a fatal error.

No difference if you enable the module through drush or UI.

Drupal\Component\Plugin\Exception\PluginException: The plugin (reroute_email) did not specify an instance class. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 79 of /var/www/html/web/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).

#0 /var/www/html/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(17): Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass()
#1 /var/www/html/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(85): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance()
#2 /var/www/html/web/modules/contrib/symfony_mailer/modules/mailer_policy/src/AdjusterPluginCollection.php(19): Drupal\Component\Plugin\PluginManagerBase->createInstance()
#3 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\mailer_policy\AdjusterPluginCollection->initializePlugin()
#4 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(152): Drupal\Component\Plugin\LazyPluginCollection->get()
#5 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(114): Drupal\Component\Plugin\LazyPluginCollection->getIterator()
#6 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(305): Drupal\Core\Plugin\DefaultLazyPluginCollection->getConfiguration()
#7 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(567): Drupal\Core\Config\Entity\ConfigEntityBase->preSave()
#8 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(522): Drupal\Core\Entity\EntityStorageBase->doPreSave()
#9 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(239): Drupal\Core\Entity\EntityStorageBase->save()
#10 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityBase.php(370): Drupal\Core\Config\Entity\ConfigEntityStorage->save()
#11 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(635): Drupal\Core\Entity\EntityBase->save()
#12 /var/www/html/web/modules/contrib/reroute_email/modules/reroute_email_symfony_mailer/reroute_email_symfony_mailer.install(21): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#13 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(829): reroute_email_symfony_mailer_install()
#14 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(451): Drupal\Core\Extension\ModuleInstaller->invoke()
#15 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(229): Drupal\Core\Extension\ModuleInstaller->doInstall()
#16 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install()
#17 /var/www/html/web/core/modules/system/src/Form/ModulesListForm.php(503): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install()
#18 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(108): Drupal\system\Form\ModulesListForm->submitForm()
#19 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(45): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#20 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(615): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#21 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(347): Drupal\Core\Form\FormBuilder->processForm()
#22 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#23 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#24 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#25 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(634): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#26 [internal function]: Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()
#27 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(649): Fiber->resume()
#28 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#29 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#30 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#31 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#32 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#33 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#34 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#35 /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#36 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(118): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#37 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(92): Drupal\page_cache\StackMiddleware\PageCache->pass()
#38 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#39 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#40 /var/www/html/web/modules/contrib/mercury_editor/src/StackMiddleware/AjaxPageState.php(38): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#41 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(53): Drupal\mercury_editor\StackMiddleware\AjaxPageState->handle()
#42 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(54): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#43 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(745): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#44 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#45 {main}

Steps to reproduce

  1. Have a basic site with Mailer Plus (DSM+) installed
  2. Install and enable reroute email
  3. Clear cache
  4. Enable the symfony mailer intergration

The config structure of SDM+ is a bit different to what it was before, so that might be related.

Proposed resolution

Fix the fatal error.

Remaining tasks

MR

User interface changes

N/A

API changes

N/A

Data model changes

N/A

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

bramdriesen created an issue. See original summary.

bramdriesen’s picture

Title: \PluginNotFoundException: The "reroute_email" plugin does not exist. » PluginException: The plugin (reroute_email) did not specify an instance class
Issue summary: View changes

bramdriesen’s picture

Title: PluginException: The plugin (reroute_email) did not specify an instance class » Compatibility with Mailer Plus (DSM+) (symfony_mailer 2.x)

Basically the module is incompatible with symfony_mailer 2.x and all it's changes.

bramdriesen’s picture

Status: Active » Needs review

Ok so the composer next failure is expected (also the case on the 2.3.x branch). As for phpunit previous major, also expected since this requires an update to 2.0.x for the symfony mailer module. Because of that this might need to be going to a 3.x or 2.4.x branch, up for the maintainer to decide.

AI was used to help fix the tests as this was driving me crazy :) as a result it might have altered some none tests files as well. I did review all changes in the final MR.

I also took the time to clean up a few things and fixed the cspell error as well by explicitly ignoring the forbidden word.

anybody’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @bramdriesen! RTBC!

@Maintainers: Please consider creating a new major release for this before merging, as suggested by https://www.drupal.org/project/symfony_mailer:

2.x has many fixes and improvements. There are substantial non-backward-compatible API and data-structure changes, which means that custom code will need to be updated (contrib modules that extend this project are recommended to create a new major version). There are update hooks, so the upgrade should work automatically with no custom code. Recommended for sites installing this module for the first time.