Closed (fixed)
Project:
PHPMailer SMTP
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
23 Jun 2022 at 16:57 UTC
Updated:
12 Oct 2022 at 23:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
vlyalko commentedComment #3
vlyalko commentedSettings were still not respected and debugging was still printing when email is sent. Made a few more changes in the PhpMailerSmtp.php to get the correct config values.
Comment #4
imclean commentedI can't replicate the problem with 2.0.5 or 2.1.0.
This change isn't necessary as the form is only being populated here, not saving the values, so it doesn't need to be writable.
I'm not sure what your changes to
/src/Plugin/Mail/PhpMailerSmtp.phpdo either.Can you try a fresh install of Drupal with only PHPMailer SMTP installed. You don't need the mailsystem module to send a test email.
Additional information may be useful if that doesn't work. What versions of PHP and Drupal are you using? What hosting environment (web server etc.).
Comment #5
vlyalko commentedHi imclean,
First, thank you for the great module. Great alternative for the symfony_mailer.
This $config = $this->configFactory()->get('phpmailer_smtp.settings'); does not get the updated config value. WHat ever value was set the first time the form was saved remains. This way $config = $this->config('phpmailer_smtp.settings'), i get the new updated config value.
In this plugin $config = $this->config('phpmailer_smtp.settings');, it also not getting the correct config value for me. That is why i had to make that change. Now, with the above changes, I am getting the correct values and debug information not being printed is disabled. (this was my issue. Have not checked other config values)
I will try on the fresh install without the patch and will let you know.
Comment #6
imclean commentedHave you got any related config overrides in
settings.phpor elsewhere? It's possible these are being loaded into the active configuration. If so, this is indeed a bug which which needs to be fixed here.Comment #7
imclean commentedThe form class should probably implement
getEditableConfigNames().Comment #8
imclean commentedIgnore #7, the method is already present.
Comment #9
imclean commentedI can see how the patch in #2 would help, but I'm not sure why the changes in
/src/Plugin/Mail/PhpMailerSmtp.phpare necessary.What values do you get before and after this change?
What values do you get before and after this change?
Just to confirm for my testing, are you using config overrides?
Comment #10
vlyalko commentedHi imclean,
because $this->config->get('smtp_debug_log', 0)) should have given me the correct value, but it did not.
and this $this->config->getRawData()['smtp_debug_log'] did give me the correct updated most recent value.
Comment #11
imclean commented@vlyalko, can you be more specific?
$this->config->get('smtp_debug_log', 0)return and where does it get the value from? (e.g. 0, 1, 2 etc.)$this->config->getRawData()['smtp_debug_log']return and where does it get the value from?Comment #12
imclean commentedComment #13
imclean commentedFrom the config override docs I can see getting mutable config avoids overrides, which is what might be causing a problem here.
Comment #16
imclean commented@vlyalko can you please try the dev version?
Comment #17
imclean commentedComment #18
imclean commented