CSS Aggregation Problems in Drupal 5

Tom Lee's picture

This may be old hat to some of you, but it was a near-revelation to me (and tough to find through Googling) so I thought I'd share it and potentially save others some hair pulling.

If your Drupal 5 site goes crazy when you turn on CSS aggregation, try examining your stylesheet(s) for absolutely-addressed url()s. There was (and is) a bug in Drupal 5's CSS aggregator code — since aggregated CSS has to live in a different directory from the original stylesheets, all those URLs have to be rewritten. The function that rewrites them expects them all to be relative, though. So:

background-image: url(/sites/all/themes/zen/xxx/images/something.gif);

gets turned into:

background-image: url(/sites/all/themes/zen/xxx//sites/all/themes/zen/xxx/images/something.gif);

That's obviously no good. Instead, simply make sure that your URLs are all relatively-addressed:

background-image: url(./images/something.gif);

That should be rewritten properly by the aggregator.

The more complete solution, of course, is to fix drupal_build_css_cache(). There is a patch available, but since the issue has been more thoroughly addressed in Drupal 6 and 7, not much attention is being paid to fixing it in 5. And that's probably okay: in most cases it's going to be quicker and easier to simply edit your stylesheet to use relative paths. It's best to avoid patching core when possible, and this is no exception.

Comments

rimbaud's picture

Thank you thank you thank you! This has saved me a lot of grief.

Anonymous's picture
film izle's picture

very nice and good thanks...

Ummi's picture

Badly need your help. Thank you for the update. What a ham. Help me! I can not find sites on the: Master cleanse diet product. I found only this - master cleanse diet information. baby jogger diaper bag. She surfaces that zack and cody are pressumably the dolls she became, but they are simply better. Waiting for a reply :-(, Ummi from San.

Travel's picture

I really liked that. Helped me a lot. Thanks.

Software's picture

Thanks. I really liked that. Helped me a lot.

yoxul's picture

Thank you very much for the excellent and useful subject.
alışveriş
ucuz alışveriş
bayan giyim
erkek giyim
giyim
fantazi giyim
pet shop
fiyatı
outlet
ucuz

Victoria's picture

Good afternoon. Everyone wants to be Cary Grant. Even I want to be Cary Grant. Help me! Can not find sites on the: Caduet, pfizer was using sobre for the conducted uses.. I found only this - [URL=http://www.comune.pompiano.brescia.it/Members/Caduet/what-is-caduet-tabs]what is caduet tabs[/URL]. Caduet, but: from the tinnitus of pharmacokinetics online eligible songs smoke only take to view. Thanks :eek:. Victoria from Ireland.

sohbet's picture

I know my little sohbet brother has set up a photo booth at yonja birthday parties and gives away the photos dini sohbet as party favors.You can have people make a RFL banner to porno izle siteleri use as a backdrop. mirc Have a digital camera, a few memory cards, and a photo printer on site. You can easily charge sohbet $5 a photo. That will be enough to cover your sohbet cost for the ink and still make a significant profit to give to ACS sohbet

sohbet's picture

I know my little sohbet brother has set up a photo booth at yonja birthday parties and gives away the photos dini sohbet as party favors.You can have people make a RFL banner to porno izle siteleri use as a backdrop. mirc Have a digital camera, a few memory cards, and a photo printer on site. You can easily charge sohbet $5 a photo. That will be enough to cover your sohbet cost for the ink and still make a significant profit to give to ACS sohbet

sohbet's picture

I know my little sohbet brother has set up a photo booth at yonja birthday parties and gives away the photos dini sohbet as party favors.You can have people make a RFL banner to porno izle siteleri use as a backdrop. mirc Have a digital camera, a few memory cards, and a photo printer on site. You can easily charge sohbet $5 a photo. That will be enough to cover your sohbet cost for the ink and still make a significant profit to give to ACS sohbet

Jeniffercy21's picture

If different people want to have high mark at any field of science you would purchase dissertation handbook and thesis writing. I did that a lot of times. I meant about dissertation writing service in essays writers.

Anonymous's picture

nice post. i have been researching drupal,and this is the first post that had anything negative to say.hmm now i don't no what t do again...joomla or drupal?? or just stick with wordpress to help my business

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockcode>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
Are you a robot? We usually like robots, but not in our comments.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.