When you disable the devel module it will attempt to restore the smtp library setting by copying the value of the devel_old_smtp_library variable into the smtp_library variable.
However the devel_old_smtp_library variable is only set when you visit the devel module's settings page. If you disable the module without ever visiting the settings page it will just blank your current smtp_library value since devel_old_smtp_library doesn't exist.
Either devel_old_smtp_library should be set when you enable the module or the disable should be a bit more discerning about what it actually changes.

Files: 
CommentFileSizeAuthor
#5 devel-6.x-1.26-smtp-library-3.patch961 bytesDmitriy.trt
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]
#3 devel-6.x-1.26-smtp-library-2.patch1.02 KBDmitriy.trt
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]
#1 devel-6.x-1.26-smtp-library.patch1.02 KBDmitriy.trt
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]

Comments

Version:6.x-1.x-dev» 6.x-1.26
Priority:Normal» Major
Status:Active» Needs review
StatusFileSize
new1.02 KB
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]

Setting major priority, because this bug could completely break email sending for a whole site, like it was in our case.

Patch was made from stable 6.x-1.26 version, it fixes problem.

Status:Needs review» Needs work

Thank you for the patch.

+++ mod/devel.install 2011-09-01 18:07:11.000000000 +0700
@@ -94,9 +94,19 @@
+  $old_smtp = variable_get('devel_old_smtp_library', '');
+  $current_smtp = variable_get('smtp_library', '');

Please use NULL instead of '' and...

+++ mod/devel.install 2011-09-01 18:07:11.000000000 +0700
@@ -94,9 +94,19 @@
+  if ($current_smtp == drupal_get_filename('module', 'devel') || $current_smtp == '') {

... empty() rather than =='' and swap the conditions.

+++ mod/devel.install 2011-09-01 18:07:11.000000000 +0700
@@ -94,9 +94,19 @@
+    if ($old_smtp != '') {
+      variable_set('smtp_library', $old_smtp);
+    }
+    else {
+      variable_del('smtp_library');
+    }

Again empty() and swap.

This is to encourage clean and efficient coding.

Status:Needs work» Needs review
StatusFileSize
new1.02 KB
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]

Made all changes, here is a new version.

Status:Needs review» Needs work

Much better. empty() and isset() are very fast, much faster than comparisons.

+++ mod/devel.install 2011-09-16 10:39:58.000000000 +0700
@@ -94,9 +94,19 @@
+    variable_del('devel_old_smtp_library');

Should this go outside the braces?

Status:Needs work» Needs review
StatusFileSize
new961 bytes
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]

Yes, you're right.

Status:Needs review» Fixed

Committed to D6 -dev. Not applicable to the other versions.

Thanks!

Status:Fixed» Closed (fixed)

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