Closed (fixed)
Project:
SMTP Authentication Support
Version:
5.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
4 Jun 2006 at 12:27 UTC
Updated:
30 Jul 2006 at 21:45 UTC
Many of us put all contributed modules in a contrib subdirectory for the case we would want to upgrade. I did, and when I activated the module and enabled it in administer >> settings >> smtp, it gave me a "Can't find module" error (which was not only shown to me as the admin, but also to registered and anonymous users) in every page of my site. I did a fast researching and the problem is this line:
if (variable_get('smtp_on', 1)) {
if (is_file(getcwd() . '/' . 'modules/smtp.module')) {
variable_set('smtp_library', 'modules/smtp.module');
}elseif (is_file(getcwd() . '/' . 'modules/smtp/smtp.module')) {
variable_set('smtp_library', 'modules/smtp/smtp.module');
} else {
drupal_set_message(t("Can't find module"), 'error');
}Obviously, the easiest fix is to put the module in the 'modules' folder. But if you take have loads of contrib modules like me and want to put everything where it belongs, then this fix will do:
if (variable_get('smtp_on', 1)) {
if (is_file(getcwd() . '/' . 'modules/smtp.module')) {
variable_set('smtp_library', 'modules/smtp.module');
}elseif (is_file(getcwd() . '/' . 'modules/smtp/smtp.module')) {
variable_set('smtp_library', 'modules/smtp/smtp.module');
}elseif (is_file(getcwd() . '/' . 'modules/contrib/smtp.module')) {
variable_set('smtp_library', 'modules/contrib/smtp.module');
} else {
drupal_set_message(t("Can't find module"), 'error');
}
Comments
Comment #1
LukeLast commentedThis problem should be totally fixed in the latest version.
Comment #2
(not verified) commented