I tried both agreggating css with my subtheme and the plain zen theme to weed out my own code, and in both cases it fails. The browser doesn't matter. I get a "Connection Interrupted" error. I tried with other themes and they work just fine, so that rules out a module being the culprit. I also tried commenting out all the css files to make sure it isn't because of malformed css (I read elsewhere this can be a possible cause). Two other people seem to have the same issue. http://drupal.org/node/424136 I have yet to try this at home on my mac. I'll check later tonight.

CommentFileSizeAuthor
#14 test.css_.txt358 bytesdonquixote

Comments

gausarts’s picture

Hi,

I run csstidy (http://csstidy.sourceforge.net/) on my local and process css to strip out everything before trying drupal's own optimizer. I want to do it one at a time to avoid problems. To my findings, some of zen css produced strange combination of selectors when optimized and causes the aggregated css to fail.

The solution is to remove aphostrophy symbol (') from any comments in your css.

i'm not sure if you have done this already, but this saves me once.

Noira’s picture

I have a similar problem. Turning on CSS aggregation feels like the browser ignores the last and most i mportant CSS file. It happens on admin and panel pages in firefox, and all the way in Konqueror.

Is there any code to do one's own aggregation or what shall I do? If I switch it of IE users don't see the style at all because of IE bug!

snorkers’s picture

This is a really serious issue... to the point where I may have to migrate to another base theme (or even... develop one entirely from scratch). I haven't tried @gausarts solution - but that is not a long term fix due to the frequency of module updates (I usually have to update 1 or 2 each day, so stripping out all CSS each day is not really feasible)

Even fairly small sites with a modest amount of modules quickly exceed the 30 CSS file limit (even in IE8), so this could be a real killer in pushing Zen to Drupal newcomers. To someone starting out and trying to make their site live the Drupal guidance encourages JS/CSS/page compression on live sites and Zen just cannot handle it.

snorkers’s picture

Just spent the last couple of days chopping my theme around to use Blueprint as the base theme instead of Zen... Alas, the site crashes with CSS compression enabled too. Only tenuous link, however, is that I'm using a fluid Zen-based subtheme as the Admin theme. However, the odds are that they may some other issue, not just Zen's fault.

johnalbin’s picture

Status: Active » Closed (won't fix)

@Noira, Your issue sounds different than the one described here.

This is not a Zen issue. CSS Aggregation works just fine with Zen.

Which means its something to do with your system. :-( I wish I could give you guys some hints about what might be causing it, but I have no clue. Actually, maybe I do have a hint: turn off "Page compression" on the admin/settings/performance page and see if that fixes the issue; that's just a wild guess.

If you are still having issues with CSS aggregation, you would need to find/post an issue in the main drupal issue queue: http://drupal.org/project/issues/drupal Best of luck!

CPyle’s picture

I am also having this problem. CSS Aggregation crashes the site when switching to Zen but is fine in Garland and Rootcandy. By "Zen" I mean the Zen base theme.

This happens with or without page caching or compression, and I've tried it on a clean site with virtually nothing else added with the same results. This happens even on 2.x-dev.

FlymastaFlex’s picture

Try to turn off the trigger module. This solved my problem immediately.

If you need the trigger module, there are other ways... But try this out first.

OldAccount’s picture

Has anybody had any luck solving this yet? I've tried all the suggestions here and here and still no luck.

OldAccount’s picture

Try this workaround, worked for me: http://drupal.org/node/331915#comment-1357688

Garrett Albright’s picture

I too ran into problems with CSS optimization causing PHP to die when Zen-based themes are used. I could never figure it out. I tried tweaking settings, reinstalling Zen, reinstalling Drupal, reinstalling and reconfiguring PHP, reinstalling Lighty… Ultimately I asked my VPS host to completely wipe my VPS (I didn't have anything of import on it yet), then reinstalled everything from scratch, and… it worked. Arbitrary!

So I'm not sure this is an issue with Zen or Drupal. I think it might be a PHP bug. For what it's worth, my web server is communicating with PHP via FastCGI; perhaps that's relevant?

FlymastaFlex’s picture

Did you tried to turn of the trigger module ?

dicreat’s picture

I have the same problem with ZEN theme even if I turn off the trigger module.

One solution here http://drupal.org/node/331915#comment-1357688 - if I cut line #1982 in common.inc:
/\*([^*\\\\]|\*(?!/))+\*/ | # Remove comments that are not CSS hacks.
CSS optimization works fine, but comments still exists in css-file (not good).

Second solution in #1 - just remove aphostrophy symbol (') from any comments in your css.

David Stosik’s picture

Edit: Well no, just experiencing the same issue, what I was suggesting is wrong.

donquixote’s picture

StatusFileSize
new358 bytes

This problem started with the Zen theme, but now I found it's actually a buggy behavior of Drupal's CSS optimizer.

Attached is a CSS file that let me crash PHP even without the Zen theme, taken from zen-liquid.css. I only need to change little portions of this file to prevent the error from happening.

If you want to reproduce:
- put the css file somewhere in your drupal dir, and include it with drupal_include_css. I did this in my index.php, after the bootstrap.
- enable CSS file optimization (in admin/settings/performance)
- choose any theme, can be Garland.
- make sure that cached CSS files (typically in sites/default/files/css) are deleted before every page request. I added some lines to the index.php to make this happen, but you can just as well delete it by hand each time.

I do not promise that the same results will happen on your system.

Typical error message I get in Firefox (in german):

Die Verbindung zum Server wurde zurückgesetzt, während die Seite geladen wurde.

which means, more or less, "Connection to the server has been reset while loading the page."

There is no error reported in apache's error.log, except for a server restart.

donquixote’s picture

This is totally a PHP / PCRE preg_replace bug.
http://drupal.org/node/444228#comment-2089300

EDIT:
No it's not. It's a Drupal core bug: The regex stinks. See the linked issue, and try if the patch does the job.

gausarts’s picture

Unless you really want to rely on the system, for urgent solution try removing and cleaning all comments from your css with csstidy or something before trying drupal aggregation, see => http://drupal.org/node/448870#comment-1597802. This saves me on production and local.

snorkers’s picture

I agree with @donquixote that this is not a Zen issue. The various proposed patches to core (latest at #444228-47: Optimize CSS option causes php cgi to segfault in pcre function "match") seem to work, as it sorts out all the file compression problems. If you are up to patching Drupal core, then try it out and report back. For me it's worked and with compression enabled for my Frankenstein monster of a site, the performance has significantly improved.

This issue should no longer be cluttering the Zen theme issue queue.

lelizondo’s picture

In my case, I was using a non-zen theme and I had the exact same problem. Duplicating my theme and changing the name solved the problem like black magic. One note, I don't know if it is important: the problematic theme had a 3-letter name, the new theme has a 10-letter name.