The hook_prepare should be used as describe in:
http://api.drupal.org/api/function/hook_prepare/6
Nevertheless in mimemail.module we find that it is define for a totaly diferent purpose and that cause (at least in my Drupal installation) a namespace conflict becouse everytime a node is being presented to edit/create, this hook is going to be called. I must say that in my case i use the API the module mime mail provides but at the same time my module is a "node" module (defines a content type) and maybe this combination is lethal, anyway i think the mimemail_prepare hook is being used in a wrong way.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | mimemail.710116_02.patch | 2.22 KB | sgabe |
| #1 | mimemail.710116_01.patch | 1.75 KB | sgabe |
Comments
Comment #1
sgabe commentedThe attached patch changes the
mimemail_prepare()function tomimemail_prepare_message()to prevent function collision withhook_prepare()in modules that uses MimeMail API and defines custom content type(s).Please review it and set to RTBC if it's fine.
Comment #2
neoglez commentedThanks for the answer.
It still has a problem (also the patch):
if (is_null($sender)) { // use site default for sender
@@ -168,7 +168,7 @@
$message = $engine_prepare
(also in here must be $engine_prepare_message)($sender, $recipient, $subject, $body, $plaintext, $headers, $text, $attachments, $mailkey);
}
else {
- $message = mimemail_prepare($sender, $recipient, $subject, $body, $plaintext, $headers, $text, $attachments, $mailkey);
+ $message = mimemail_prepare_message($sender, $recipient, $subject, $body, $plaintext, $headers, $text, $attachments, $mailkey);
}
return $engine('send', $message);
Please post another patch so i can test it and close the issue.
Still a Great module!
Comment #3
sgabe commentedThanks for your feedback, attaching a revised patch of #1.
If you think it's okay, please don't close the issue, change to RTBC instead.
Comment #4
neoglez commentedIt seems to be OK now. Thanks!
Comment #5
vatavale commented-deleted-
Comment #6
sgabe commentedCommitted to HEAD.