Problem/Motivation
I have at least two problems when I try to update symfony_mailer to version 2.0.0.
Most obviously, no email is being logged anymore. At first I thought this might be a problem in symfony_mailer not even trying to send it - since I am only testing this on a local dev environment it doesn't actually send email - but I am now thinking it is more likely that it just isn't logging anymore.
I say that in part because of the second error. When I go to /admin/config/system/mailer/policy, or if I try to uninstall symfony_mailer_log, I get:
The website encountered an unexpected error. Try again later.
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "symfony_mailer_log" plugin does not exist. Valid plugin IDs for Drupal\mailer_policy\EmailAdjusterManager are: email_priority, email_cc, email_sender, email_subject, email_body, email_theme, email_plain, email_transport, email_reply_to, mailer_url_to_absolute, email_bcc, mailer_inline_css, email_from, mailer_wrap_and_convert, email_to, mailer_inline_images, email_skip_sending in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
Drupal\Core\Plugin\DefaultPluginManager->getDefinition('symfony_mailer_log') (Line: 16)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('symfony_mailer_log', Array) (Line: 85)
Drupal\Component\Plugin\PluginManagerBase->createInstance('symfony_mailer_log', Array) (Line: 19)
Drupal\mailer_policy\AdjusterPluginCollection->initializePlugin('symfony_mailer_log') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('symfony_mailer_log') (Line: 27)
Drupal\mailer_policy\AdjusterPluginCollection->sortHelper('mailer_inline_css', 'symfony_mailer_log')
uasort(Array, Array) (Line: 90)
Drupal\Core\Plugin\DefaultLazyPluginCollection->sort() (Line: 262)
Drupal\mailer_policy\Entity\MailerPolicy->getSummary() (Line: 54)
Drupal\mailer_policy\MailerPolicyListBuilder->buildRow(Object) (Line: 308)
Drupal\Core\Entity\EntityListBuilder->render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing('mailer_policy')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 634)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():634}()
Fiber->start() (Line: 635)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 118)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 92)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 745)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
There's maybe a third that I'm not sure if it is coming from symfony_mailer or symfony_mailer_log. Since I can't uninstall symfony_mailer_log I don't have an easy way to find out which. If I try to clear caches through drush, I get:
In Container.php line 147:
Circular reference detected for service "Drupal\Core\Logger\LoggerChannelFactoryInterface", path: "scheduler.manager -> logger.channel.scheduler -> D
rupal\Core\Logger\LoggerChannelFactoryInterface -> logger.stdout -> Drupal\mailer_override\OverrideManagerInterface -> token -> cache_tags.invalidato
r -> plugin.manager.block -> logger.channel.default".
Steps to reproduce
Update symfony_mailer to 2.0, with symfony_mailer_log still on 1.2.4. Proceed with the actions described above.
Proposed resolution
Long-term, complete required updates to work with 2.0.
Short-term, is there a way to specify to not update symfony_mailer yet, so that others don't get stuck with the same problems I did?
Issue fork symfony_mailer_log-3591380
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
Comment #4
wlofgren commentedComment #5
ryan-l-robinson commentedThank you! This seems to resolve the issues for me.
The last one about the circular reference I'm not clear about because I can't seem to always replicate it the same way, so I'm going to assume that is unrelated.
Comment #6
svendecabooterDoes this MR remove support for symfony_mailer 1.6.x? Is there a way to make it work with both versions if so? Since both branches of the module are still supported, this module should also support both.
Comment #7
svendecabooterComment #9
svendecabooterI have created a new MR (19) that combines the 2.x support added by wlofgren, with the backwards compatibility for 1.6.x, so the module can work with both branches of the symfony_mailer module.
Can this be tested? Please indicate whether you have tested this with symfony_mailer 1.6.x or 2.0.x.
Comment #10
ryan-l-robinson commentedI tried the updated version (applied as a patch) against symfony_mailer 1.6.2. No obvious issues there, with mail being logged and no errors showing anywhere I can see.
Then I upgraded symfony_mailer to 2.0.1. That also worked to log the mail and with no errors anywhere I can see.
Comment #11
svendecabooterThanks for the review.
I will merge and create a new release.