As a result of this bug report there is now a new bug.

For those of us that use gulp/grunt for sass and js building without use of preprocessor within Drupal this module now loads source sass, which obviously doesn't work. It would make sense to check for SASS/LESS preproecssor module before adding sass/less to the file scan.

if (module_exists("sass") || module_exists("sassy")) {
  $mailstyles = file_scan_directory($themepath, '#^mail(-.+)?\.(c|sc|sa)ss$#');
} else if (module_exists("less") || module_exists("twbs_less")) {
  $mailstyles = file_scan_directory($themepath, '#^mail(-.+)?\.(c|le)ss$#');
} else {
  $mailstyles = file_scan_directory($themepath, '#^mail(-.+)?\.css$#');
} else 
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xrxphawxby created an issue. See original summary.

xrxphawxby’s picture

Fix included that doesn't require lots of module_exists tests

xrxphawxby’s picture

Assigned: Unassigned » xrxphawxby
Status: Active » Needs review
xrxphawxby’s picture

I was clearly a little too eager the first time I wrote this patch. *sigh*

xrxphawxby’s picture

lukedekker’s picture

Just ran into this issue when updating to the latest version of MimeMail. Assuming that the user is making use of a preprocessor seems like a horrible idea.

sjerdo’s picture

Experienced the same issue. A .scss files was loaded instead of the .css file.
Updated the patch.

dmsmidt’s picture

Status: Needs review » Reviewed & tested by the community

Tested, works like a charm. Patch also confirms to our coding standards.

dmsmidt’s picture

Version: 7.x-1.0-beta4 » 7.x-1.0
Assigned: xrxphawxby » Unassigned
Priority: Normal » Critical

Marking this as critical since all mail output breaks.

lukedekker’s picture

Version: 7.x-1.0 » 7.x-1.1

Just verified that this issue is still present against 7.x-1.1 and that the patch still applies cleanly and works properly.

Bumping the relevant version.

Lukas von Blarer’s picture

Version: 7.x-1.1 » 7.x-1.x-dev

Could we get this in?

TR’s picture

Priority: Critical » Normal
Status: Reviewed & tested by the community » Needs work

The patch in #5 was well commented, but introduced a number of coding standards problems that need to be addressed.

The patch in #7 didn't have any coding standards problems, but it didn't do a good job of explaining in the comments what it was doing and why.

Also, both #5 and #7 assume there will be only mail.css, mail.less, mail.sass, and/or mail.scss present. But the original feature request that we're trying to fix here, #2146513: Scan Theme for other *css* file types (Preprocessors), also introduced the use of multiple style sheets named mail-*.css, etc. The patches in #5 and #7 ignore these additional style sheets.

We need a new patch to address these points. And it would be really nice to have a test to ensure that the expected style sheets are located properly by this module. If we had a test case for #2146513: Scan Theme for other *css* file types (Preprocessors) this bug may not have been introduced. And if we had a test case as part of #5 or #7 it might have caught the fact that the additional mail-*.css stylesheets were being missed.

(The issue queue priority guidelines indicate that this is clearly a "Normal" priority bug. Please read the guidelines, linked below, before resetting the priority.)