It would be great with a setting for disabling advanced aggregration for logged in users with access to admin pages. This module can cause a lot of headaches with poorly written contrib modules' javascript. It would be a really nice to just be possible to disable aggregation for the backend, since performance may be less of a concern here.

Comments

supermoos created an issue. See original summary.

mikeytown2’s picture

Would the Aggregation Bypass Cookie on the admin/config/development/performance/advagg/operations page work in this case, set it to 1 year?

supermoos’s picture

Well no not really. The cookie would need to be automatically set somehow at least. Otherwise, all new users would need access to the performance backend to set this cookie. The cookie thing seems like a hacky solution. Also the cookie seems to have no effect on my system. Could it be because I am using a Redis cache store?

mikeytown2’s picture

https://www.drupal.org/sandbox/alanmackenzie/2135127 might be what you're looking for.

Enable the module and then use these settings.

$conf['role_aggregation_enabled'] = TRUE;
$conf['role_aggregation_rid'] = 1;

This will disable css/js aggregration if the user doesn't have the anonymous user role. To do exactly what you want I'd change the module so it looks like this (remove `!` from the last if statement).

/**
 * Implements hook_init().
 */
function role_aggregation_init() {
  global $conf;
  global $user;

  if (!variable_get('role_aggregation_enabled', FALSE) ||
      is_null(variable_get('role_aggregation_rid'))) {
    return;
  }

  // Disable aggregation if user has this user role.
  if (isset($user->roles[variable_get('role_aggregation_rid')])) {
    $conf['preprocess_css'] = FALSE;
    $conf['preprocess_js'] = FALSE;
  }
}

And then use this in your settings.php

$conf['role_aggregation_enabled'] = TRUE;
$conf['role_aggregation_rid'] = 3;
supermoos’s picture

This seems to work great :-) Does the altered $conf settings not get saved in the database? Since they only apply to logged in users?

mikeytown2’s picture

Does the altered $conf settings not get saved in the database? Since they only apply to logged in users?

This setting is not saved in the database. You can save it in the database by running this ONCE

variable_set('role_aggregation_enabled', TRUE);

It does set the variable though; variable_get() uses the $conf global.

mikeytown2’s picture

Status: Active » Closed (won't fix)

Going to mark this as won't fix; another module does what you need