warning: Invalid argument supplied for foreach() in /.../sass/sass.module on line 31.
» warning: Invalid argument supplied for foreach() in /.../sass/sass.module on line 31. Key 'all' is hardcoded here.
This looks to be due to the hardcoding of 'all' as the key in the foreach. Some themes might declare the stylesheets as
stylesheets[screen][] = "core.css"
stylesheets[screen][] = "icons.css"
stylesheets[screen][] = "style.css"
stylesheets[print][] = "print.css"
foreach ($theme_info->stylesheets as $type)
{
foreach ($type as $stylesheet) {
$scss = str_replace('.css','.scss',$stylesheet);
# If we're in development mode clear any CSS files that have a cooresponding SCSS file.
if (variable_get('sass_development_mode', true) && file_exists($scss))
{
if (variable_get('sass_show_development_mode_warning', true))
{
drupal_set_message(t('Your SASS / SCSS stylesheets are currently being rebuilt on every request. Ensure you disable <a href="!link">development mode</a> for production sites.', array('!link'=>url('admin/settings/phamlp/sass'))),'warning');
}
if (file_exists($stylesheet))
{
unlink($stylesheet);
}
}
if (!file_exists($stylesheet) && file_exists($scss))
{
file_put_contents($stylesheet, $sass->toCss($scss));
}
}
}
Got rid of the error. I don't know if you need a patch for this, but it is a fairly simple fix. BTW, on a side-note the module does not follow drupal coding standards for whitespace or comments.
Comments
Comment #1
nicholas.alipaz commentedThis looks to be due to the hardcoding of 'all' as the key in the foreach. Some themes might declare the stylesheets as
stylesheets[screen][] = "core.css"
stylesheets[screen][] = "icons.css"
stylesheets[screen][] = "style.css"
stylesheets[print][] = "print.css"
Rubik does this actually.
Comment #2
nicholas.alipaz commentedI replaced line 31's foreach with this:
Got rid of the error. I don't know if you need a patch for this, but it is a fairly simple fix. BTW, on a side-note the module does not follow drupal coding standards for whitespace or comments.
Comment #3
nicholas.alipaz commentedah, I guess there is an issue open for the coding standards thing: #1604776: Follow coding standards
Comment #4
ken hawkins commentedThis problem also exists in the 7.x version.
If your theme uses 'screen' stylesheets, the will be ignored.
Can be worked around by modifying lines:
@53
and @62