Is there a reason to get the original css in advagg_processor from $variables['css'] instead of drupal_add_css()?

I have a problem with this in combination with the Omega theme. The preprocess_page function of this theme adds css files with drupal_add_css and puts those in the page with $vars['styles'] = drupal_get_css(); In that way, these css files are not present in $variables['css']. You can say that this is a problem of Omega, but a lot of themes do it like that.

So could you give some more insight in using $variables['css'] or can we just change this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pgrond’s picture

Title: get css with druapl_add_css instead of $variables['css'] » get css with drupal_add_css instead of $variables['css']
pgrond’s picture

Hmm, maybe it is not a good idea. Using drupal_add_css doesn't play well with dcss.
Will try to fix this in the theme layer.

mikeytown2’s picture

Status: Active » Postponed (maintainer needs more info)
FileSize
1.11 KB

Waiting to hear back what you think is the best way to handle this. BundleCache uses $variables['css']; I figured that module has been out longer and thus battle tested, so I copied that design.

this patch has been committed.

pgrond’s picture

Hi,

I think it is enough to do a array_merge of $variables['css'] and drupal_add_css().
Now I think of it, I think it is an error if a theme changes the css and not update the $variables['css'], but I think more themes do that. So, if they use drupal_add_css and $variables['styles'] = drupal_get_css() to change the files, an array_merge will catch this.

mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Active
mikeytown2’s picture

Status: Active » Fixed
FileSize
4.83 KB

committed this patch. Merges the 2 array together.

Status: Fixed » Closed (fixed)

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