Skip to content

Instantly share code, notes, and snippets.

@randallknutson
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save randallknutson/dbfe394b5efdf40d2775 to your computer and use it in GitHub Desktop.

Select an option

Save randallknutson/dbfe394b5efdf40d2775 to your computer and use it in GitHub Desktop.
diff --git a/includes/common.inc b/includes/common.inc
index 63b691e..e58560c 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -4390,7 +4390,13 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
// Aggregate any remaining JS files that haven't already been output.
if ($preprocess_js && count($files) > 0) {
foreach ($files as $key => $file_set) {
- $uri = drupal_build_js_cache($file_set);
+ // There is no way to override this in ajax.
+ if (module_exists('agg')) {
+ $uri = agg_build_js_cache($file_set);
+ }
+ else {
+ $uri = drupal_build_js_cache($file_set);
+ }
// Only include the file if was written successfully. Errors are logged
// using watchdog.
if ($uri) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment