After enabling CSS Aggregation and CSSTidy one of the ctools css files now fails to load. If I disable CSS Aggregation or CSSTidy, everything works. When I navigate to where the ctools css file should be, it's there but has nothing in it. It is also named "0890393f586c5a6e28e86667db41a1ca_tidy.css?I". I think that the "?I" appended to the file name might be the problem.

Before <link ... href="/sites/default/files/ctools/css/0890393f586c5a6e28e86667db41a1ca.css?7" />
After <link ... href="/sites/default/files/ctools/css/0890393f586c5a6e28e86667db41a1ca_tidy.css?I" />

Comments

philbar’s picture

Title: CSSTidy is possibly breaking ctools and panels » CSSTidy Deletes Ctools CSS
Priority: Normal » Critical

I've verified the problem. Hopefully I can figure out a solutions soon.

philbar’s picture

You are right. It has to do with ctools adding ? and a random character to the end of css files.

We need to remove the ? and the random character when getting the $aggregated_file_name. Below is the code we need to adjust. Any suggestions?

function _csstidy_process($styles) {
// Line #64 of csstidy.module
    // Discover Aggregated CSS and Optimize Using CSSTidy
    $path_to_files_directory = base_path() . file_directory_path();
    $pattern = '/<link(.*?)href="' . preg_quote($path_to_files_directory, '/') . '(.*?)"(.*?)\\/>/';
    if (preg_match_all($pattern, $styles, $matches) > 0) {
        foreach ($matches[2] as $i => $aggregated_file_name) {

In summary, right now $aggregated_file_name will output something like this:
/ctools/css/dd40f13e1e57760f7ad8f2cf2eeef983.css?a

we need it to be like this:
/ctools/css/dd40f13e1e57760f7ad8f2cf2eeef983.css

philbar’s picture

Title: CSSTidy Deletes Ctools CSS » CSSTidy cannot find contents of Ctools Stylesheets
philbar’s picture

Status: Active » Fixed

http://drupal.org/cvs?commit=463198

This will work, but ctools css wont be processed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.