The drupal_load_stylesheet function does something bad with the mail.css code (if i paste the css code directly in the template file, instead using the $css variable, everything works fine).
If i put my CSS-code in the W3C CSS Validator, everything is fine. If i put the "optimized" CSS-code in the Validator i get parse errors.
Could you please add an option in the Mimemail settings to turn this "optimization" on or off?
It´s up to: modules\contrib\mimemail\theme\mimemail.theme.inc <-- line 85
$css .= drupal_load_stylesheet($style, TRUE);
Should be
$css .= drupal_load_stylesheet($style, FALSE);
or even better and compatible to the current options:
$css .= drupal_load_stylesheet($style, variable_get('mimemail_setting_drupal_load_stylesheet_optimize'), TRUE);
as new option.
If you agree and there is an active maintainer willing to apply it, we can create a patch of course!
Please reply.
Thank you :)
Comments
Comment #1
thomas.frobieterComment #2
AnybodyI can confirm that this problem exists. The new option is a feature request but the result of the problem is a bug.
+1 for this.
Is there an active maintainer?
Comment #3
sgabe CreditAttribution: sgabe commentedIf this is a bug, then we should fix it instead of going around it...
Is there an issue for Drupal core regarding this bug?
Comment #4
AnybodyWell I think this may be related: #1686178: CSS compressor destroys valid css "content" attribute values
But I'm not sure yet. @thomas.frobieter, can you find out which exact statement leads to the problem and if it may be related to the issue above?
Anyway @sgabe: Should't we allow to process the CSS without compression? (As module setting or variable?)
Comment #5
AnybodyThe problem is now open since six month without any progress. We should take this forward because the problem still exists.
From my point of view it would be absolutely okay to add a setting to disable optimization PLUS we should find out if the problem behind can be fixed (which can not be done within the module I think).
How shell we proceed?
Comment #6
sgabe CreditAttribution: sgabe commentedAs a workaround, let's just add an option to disable optimization on the administration interface.
Comment #7
AnybodyWhao that would be great!
Will you add that option? Do you need any help? Of course I'm willing to test.
Thank you so much!! :)
Comment #8
hass CreditAttribution: hass commentedIf this is a whitespace you can easily replace the whitedpace with unicode characters and the issue is solved.
Comment #9
TR CreditAttribution: TR commentedThis is an issue with core, not with Mime Mail. It was fixed in Drupal core D8 and D9 by #936316: CSS aggregation strips some essential whitespace within strings, but was never backported to core Drupal D7 - that is supposed to be done by #2877131: [D7] CSS aggregation strips some essential whitespace within strings.
If this issue affects you, please contribute in #2877131: [D7] CSS aggregation strips some essential whitespace within strings and please use the patch there.
Marking this as "Postponed" because there's nothing we need to do in Mime Mail to fix this - it will resolve itself when core fixes the problem.
Comment #10
TR CreditAttribution: TR commentedThe core issue has now been committed. I am going to assume that fixed the above problem.
If the problem still happens with the current DEV version of core Drupal, feel free to reopen the issue.