A new version (alpha 6), and it displays just an empty message (HTML).
Removal of $subject argument (theme() function) in line 128 of mimemail.module (probably related to #752838: Pass $subject to the template) seems to resolve the issue.
A new version (alpha 6), and it displays just an empty message (HTML).
Removal of $subject argument (theme() function) in line 128 of mimemail.module (probably related to #752838: Pass $subject to the template) seems to resolve the issue.
Comments
Comment #1
sgabe commentedClearing the caches will solve the problem.
Comment #2
luti commentedI've ran update.php after updating. This should already clear the cache, or?
Now, I've tried to manually clear the cache (Administer -> Performance -> "Clear cached data" button). No success either (as long as $subject argument is there).
Comment #3
sgabe commentedThis should be a cache issue. I think you get the $mailkey - which was the second parameter before - as $body, but it is empty so you don't see anything. Please clear the browser's cache too.
Comment #4
luti commentedCleared that too. No success... :-(
$mailkey is empty. But, $mailkey was the 3rd parameter before (2nd was $body).
Comment #5
sgabe commentedCan you reproduce this on a clean install?
Before:
After:
So now you get the $mailkey as $body, try using $subject instead of $body in the template, let see what happens.
Comment #6
luti commentedHi,
I am not sure I understand you well...
I've replaced a complete mimemail folder (with all subfolders), version alpha5 (which worked well) with alpha6 (which is sending an empty message).
In new theme/mimemail.theme.inc, version 1.9, it is like you write ("After", with 'subject' => NULL). In the old alpha5, version 1.6, it was as your "Before" (without 'subject' => NULL).
After the replacement, I've gone through /update.php process, manually cleared the Drupal cache (Administer -> Performance -> "Clear cached data" button) and cleaned Firefox cache as well.
I've edited theme/mimemail-message.tpl.php replacing $body with $subject (line 35).
Message arrived practically the same. But, it is not empty (my mistake in my initial post!) - it contains a node subject (instead of a node body).
I've printed out variables before and after $body = theme(...) call in line 128 (within mimemail.module file). $body gets a subject of node appended instead of a node body (sound reasonable to me, if I pass it instead of a body to the function...) and not the opposite (as you've suggested to try in template).
Are you sure $subject has to be the 2nd argument (and, $body the 3rd one, instead of 2nd as before...) of a theme function call in line 128 now? Considering the theme() function hasn't change, or?
Should maybe a closing bracket of array() in line 128 be moved after $subject - so the $subject is the 3rd item of the 1st argument (array)? Trying to do that, I am getting mail well (as expected)...
Comment #7
sgabe commentedYes, I am sure. See hook_theme() in the API documentation: The arguments must be in the same order that they will be given to the theme() function.
$body = theme(array('mimemail_message__'. $mailkey, 'mimemail_message'), $subject, $body, $mailkey);The order of the arguments is right.
Definitely not. The first parameter of theme() is $hook - the name of the theme function to call - which may be an array to provide 'fallback' theme implementation. The $subject can't be an element of that array.
However it's odd that more than 5000 sites uses alpha6 by now and so far no one else encountered this pretty big bug...
Comment #8
luti commentedThank you for your feedback. Made me think again, and I hope I've finally resolved it...
Sorry for the mess, it was obviously a function phptemplate_mimemail_message() (which was together with simplenews.css in my custom theme template.php; I haven't even remember to put it there in the past).
I've removed it, and use mimemail_message.tpl.php / simplenews-newsletter-body.tpl.php and mail.css instead. Seems to work fine now (altough I have to test it a bit more, I think).
Comment #9
luti commented