If no style is defined this error e thrown when sending the mail. The mail is sent without any problem, but the message is presented to the user.
This happens if in the Mime Mail configuration the "Include site style sheets" combo isn't checked and you don't provide any other.
I also found the solution, but still trying to work with GIT to create a patch file. But here's the code :
File : mimemail.theme.inc
Patch :
«
@@ -86,10 +86,12 @@
// Process each style sheet.
$css = '';
- foreach (explode("\n", $styles) as $style) {
- if (!empty($style) && @file_exists($style)) {
- $css .= @file_get_contents($style);
- }
+ if (isset($styles)) {
+ foreach (explode("\n", $styles) as $style) {
+ if (!empty($style) && @file_exists($style)) {
+ $css .= @file_get_contents($style);
+ }
+ }
}
// Regexp to match comment blocks.
»
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | mimemail_1289584_03.patch | 4.76 KB | sgabe |
| #4 | mimemail_1289584_02.patch | 2.95 KB | sgabe |
| #1 | mimemail_1289584_01.patch | 2.91 KB | sgabe |
Comments
Comment #1
sgabe commentedI would go further, since the CSS optimization also unnecessary when no style is defined.
Comment #2
sgabe commentedChanging status.
Comment #3
carn1x commentedManually applied patch in #1, seems to be working fine.
Comment #4
sgabe commentedI am attaching a new patch to deal with #1290636: Notice: Undefined variable: css in include() (line 24 of theme/mimemail-message.tpl.php).
Comment #5
carn1x commentedManual application of patch in #4 works fine thanks :)
Comment #6
luti commentedApplied the patch #4 to the latest 7.x-1.x-dev (2011-Sep-17), but still getting the same errors (when requesting a new password, after clicking "E-mail new password"...):
Comment #7
ibes commentedpatch in #4 works for me
LUTi in #6 has enabled the module "Mime Mail CSS Compressor". This submodule of mimemail searches (preg_match) for css in the mail text, seperates it from the rest of the mail and compress it.
" in the mail - like it is, in our case - there are no results of the search (preg_match) and so the script give back a notice. I am not quite sure how to skip the Compressor, when there is no css in the message. Is there a way to disable the module if the "Include site style sheets " checkbox is unchecked?If there is no "
Comment #8
sgabe commentedThen this needs a little more work.
Comment #9
sgabe commentedI am attaching a revised patch according to LUTi's reply.
Comment #10
ibes commentedI did this test without the patch (errors as reported) and with the patch (no errors, everything like expected)
(the versions drush loads by default)
- webform (send html mail with attachment)
- rules (send html mail)
- simplenews (send html newsletter)
- hook_mail_alter() in my own module
works with and without stylesheets
In my opinion the patch of #9 works
Comment #11
sgabe commentedThanks ibes for testing. I did also some testing and the patch seems to solve the issue.