I have a module that uses mailsystem. My hook_enable()
looks like this:
mailsystem_set(
array(
'my_module_name' => array(
'format' => 'TheMailSystemName',
),
)
);
When I first enable that module, mailsystem cleverly creates a new wrapper class called TheMailSystemName__DefaultMailSystemName
into sites/default/files/mailsystem
as TheMailSystemName__DefaultMailSystemName.mail.inc
in order to use TheMailSystemName
's format()
method, but DefaultMailSystemName
's mail()
method. Pretty awesome so far.
I also have this code in my hook_disable()
for my module:
mailsystem_clear(
array(
'my_module_name' => array(
'format' => 'TheMailSystemName',
),
)
);
If I disable my module, and I re-enable it. I get a sad "The website encountered an unexpected error. Please try again later.
" message. Even though there is that message, the module does enable successfully, but the mail_system
variable that this module is working with does not get setup correctly. When I go to /admin/config/system/mailsystem
I do not see my module associated with the newly-written TheMailSystemName__DefaultMailSystemName
class, and I have to set it up via the GUI in there.
What am I doing wrong?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#5 | mailsystem.1359482.5.patch | 731 bytes | tobiasb |
Comments
Comment #1
enrique.delgado CreditAttribution: enrique.delgado commentedComment #2
DuaelFrThis is a bug :)
SQL request for cleaning registry are prepared but never executed.
In the mailsystem.module file find
and replace it by
Sorry but I cannot provide a proper patch for the moment.
I hope this will help.
Comment #3
enrique.delgado CreditAttribution: enrique.delgado commentedWow, I had notifications disabled on drupal.org so I'm just now seeing this! Code changes applied. Thanks DuaelFr!
Comment #4
DuaelFrYou are welcome :)
Cannot mark the issue as fixed or need review as there is no dev version of the module but in my case it was working well.
Comment #5
tobiasbHere is the patch for the bug ;-)
Comment #6
Les LimPatch looks good. As registry cleanup is fairly important, bumping this to major.
Comment #7
das-peter CreditAttribution: das-peter commentedUpdates on this? Patch is RTBC quite long now :)
Comment #9
Nafes CreditAttribution: Nafes as a volunteer commentedCommitted. Thank you for the patch, tobiasb!