diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-28 22:11:46 -0800 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-28 22:11:46 -0800 |
commit | 4ac6433a74df2e4b443fa6a314adb3ad4a152d8b (patch) | |
tree | c5680ef3dd68f49b359937fb42e97061f7d49b42 /includes | |
parent | 0f8e2094a3cf33a8018ee394e56bad57b3d0f89c (diff) | |
download | brdo-4ac6433a74df2e4b443fa6a314adb3ad4a152d8b.tar.gz brdo-4ac6433a74df2e4b443fa6a314adb3ad4a152d8b.tar.bz2 |
Issue #967166 by effulgentsia, Cottser, no_commit_credit, KrisBulman: Fixed Content rendered via AJAX does not respect stylesheets removed in .info files.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/includes/common.inc b/includes/common.inc index d799616d4..021e1a47d 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2969,6 +2969,18 @@ function drupal_get_css($css = NULL, $skip_alter = FALSE) { // Sort CSS items, so that they appear in the correct order. uasort($css, 'drupal_sort_css_js'); + // Provide the page with information about the individual CSS files used, + // information not otherwise available when CSS aggregation is enabled. The + // setting is attached later in this function, but is set here, so that CSS + // files removed below are still considered "used" and prevented from being + // added in a later AJAX request. + // Skip if no files were added to the page or jQuery.extend() will overwrite + // the Drupal.settings.ajaxPageState.css object with an empty array. + if (!empty($css)) { + // Cast the array to an object to be on the safe side even if not empty. + $setting['ajaxPageState']['css'] = (object) array_fill_keys(array_keys($css), 1); + } + // Remove the overridden CSS files. Later CSS files override former ones. $previous_item = array(); foreach ($css as $key => $item) { @@ -2989,13 +3001,7 @@ function drupal_get_css($css = NULL, $skip_alter = FALSE) { '#items' => $css, ); - // Provide the page with information about the individual CSS files used, - // information not otherwise available when CSS aggregation is enabled. - // Skip if no files were added to the page or jQuery.extend() will overwrite - // the Drupal.settings.ajaxPageState.css object with an empty array. - // Cast the array to an object to be on the safe side even if not empty. - if (!empty($css)) { - $setting['ajaxPageState']['css'] = (object) array_fill_keys(array_keys($css), 1); + if (!empty($setting)) { $styles['#attached']['js'][] = array('type' => 'setting', 'data' => $setting); } |