Closed (works as designed)
Project:
SMTP Authentication Support
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Sep 2015 at 04:39 UTC
Updated:
8 Oct 2019 at 11:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
keboca commentedComment #3
asrob@keboca, can you give us more information about this patch? As I can see there are some fixes due to coding standards.
Comment #4
keboca commented@asrob, I list what I've done in this patch:
1.hook_install()
When module is installed, it saves settings into "smtp.settings" configuration, somehow the follow "smtp_allowhtml" key doesn't work as expected if it is defined as empty string, then I modified to an integer (I setup as zero).
Then I added a new settings "smtp_queue" to be store into "smtp.settings" by default when module is installed.
Also I am saving current system mail interface into settings to "prev_mail_system" key.
2.hook_uninstall()
When module is uninstalled, I restore system mail interface to value that Drupal had before install SMTP module, it means, I retrieve value stored at "prev_mail_system" key in "smtp.settings".
3.hook_menu()
I just removed it since we're using YAML file to discover all routes into Drupal 8.
4.SMTPConfigForm.php
When SMTPConfigForm call "buildForm" method, I expose "smtp_queue" email option into form emails,
It is because when "SMTPMailSystem" class invokes "mail" method, it tries to retrieve this value from settings at line 522:
if ($this->smtpConfig->get('smtp_queue')) {But it wasn't available into "smtp.settings" settings reason why I exposed.
Then when "submitForm" method is called, I load current system mail interface setting into a temp variable ("$mail_interface") and I setup "SMTPMailSystem" as default interface in order to send test email using this interface.
After that I check that current SMTP option is already enabled and SMTP interface is different than system mail interface saved into $mail_interface, if so I save "SMTPMailSystem" as default interface, otherwise I will restore system mail interface.
Basically it is what I am doing there, also a bunch of code standards from Drupal, BTW I haven't check current module version, then I don't know if it had change already, since I uploaded this patch around 9 months ago.
I hope, it helps and you could apply it to this module,
Have a ball,
Comment #5
pazhyn commentedComment #8
estoyausenteAnyway, this patch need a reroll, I can't apply it.
Comment #9
chishah92 commentedComment #10
chishah92 commentedI tried to reroll the patch , but i am not even able to apply the patch as it says the no such file or directory inspite of creating a contrib folder inside modules folder for the patch to get applied.
Please Advice
Comment #11
estoyausente@chishah92 have you try folowwing this guide?
https://www.drupal.org/patch/reroll
I don't think that it is a easy reroll. Some help:
This already did in https://www.drupal.org/node/2698513
It's ok and necessary.
This code standar refactor is nice, but... it is the correct issue?
I think that we can divide this issue in different issues (remove hook_menu, coding standards, set default mail system at uninstall...) and close it after that. It's a little bit chaotic issue.
Comment #12
chishah92 commentedYes i had referred that guide , but due to the issue which i am facing i am not even able to start fixing things.
Thanks!
~chirag
Comment #13
chishah92 commented@estoyausente , adding the new patch where i have done following things:
I hope this is at least a good start.
Thanks!
~Chirag
Comment #14
estoyausenteYeah it's a nice start.
But I think that is better put in different commits the hook_menu removal and the uninstall actions because the are different issues and problems and can be debugged and tested better separatelly.
Anyway, its look nice!
Comment #17
ashishdalviUnable to apply patch. Patch needs to be rerolled.
We will work on this issue in DrupalMumbai Code sprint #15.
Comment #18
Pradnya Pingat commentedI am working on it
Comment #19
Pradnya Pingat commentedRerolled patch with 8.x-1.x
Comment #20
wundo commented@Pradnya Pingat, looks like your patch is including a few code style changes not directly related with the issue itself, could you please submit a patch with only the necessary changes and submit the code styling changes as their own issue?
Comment #21
wundo commentedComment #22
pazhyn commentedCan we suggest changing this issue subject and description?
I think it looks confusing now and differs from the discussion and provided patches.
@Pradnya Pingat, can you specify at least correct subject for this issue, please?
Comment #23
Pradnya Pingat commented@wundo I think thats because my IDE is not configured according to drupal standards. I fixed that now .Thanks for help
Comment #24
wundo commented