We need to debug some JS but I can't figure out how to disable this module but just for JS files. I tried bundler at 0 but that doesn't work, any ideas?

Comments

mikeytown2’s picture

Category: bug » support

add ?advagg=0 to then end of the url; that should disable JS aggregation as well as CSS aggregation. If disabling CSS at the same time is a problem I could come up with a solution, but I would need a good argument for why you only need one disabled.

drubage’s picture

I meant for all users without needing the querystring. Disabling css is a problem, we mostly need the module for css aggregation as it splits our concatenated css file. Without it our css file is too large for ie, crazy as it sounds there is even a size limit aside from a number limit...

mikeytown2’s picture

If you implement hook_advagg_js_header_footer_alter() you can make all js files not be aggregated from a coding point of view. This will also allow you to pull out various files out of the aggregates if they are not suitable for aggregation. Note: Using this hook you can also move files from the header to the footer or to any region of your theme.

/**
 * Implement hook_advagg_js_header_footer_alter.
 */
function mymodule_advagg_js_header_footer_alter(&$master_set, $preprocess_js, $public_downloads) {
  // Exit if preprocessing is disabled.
  if (!$preprocess_js) {
    return;
  }

  foreach ($master_set as $scope => &$scripts) {
    // Skip if the region if it doesn't contain any JS.
    if (empty($scripts)) {
      continue;
    }
    foreach ($scripts as $type => &$data) {
      // Skip if the JS is a setting, inline, or external.
      if (empty($data) || $type == 'setting' || $type == 'inline' || $type == 'external') {
        continue;
      }
      foreach ($data as $path => &$info) {
        // Set preprocessing to false for all files.
        $info['preprocess'] = FALSE;
      }
    }
  }
}

If you still think you need a selection to disable CSS or JS let me know; I can make it happen.

drubage’s picture

That will do the trick for now thank you!

mikeytown2’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

arun ak’s picture

Issue summary: View changes

I didn't installed AdvAgg Compress Javascript module. But still my website js files are compressing. How can I avoid js compression? I want css aggregation only.

arun ak’s picture

Version: 6.x-1.5 » 6.x-1.9
Status: Closed (fixed) » Active
mikeytown2’s picture

@ARUN AK
Can you open a new issue with what you wanted vs what happened? Also be aware that there are 3 things that might cause confusion.

GZip compression
Minification
Aggregation

mikeytown2’s picture

Status: Active » Closed (fixed)