I help look after a site which uses $settings['file_public_base_url'] to serve files from a different subdomain on the frontend, but on the backend (admin paths like node/add and node/edit) this causes our JS to be loaded with absolute rather than relative URLs which seems to cause an issue with JS loaded via AJAX not executing correctly. There are no JS errors in my devtools console, but I suspect the cause is that the JS is being loaded from differing subdomains, as turning AdvAgg and core's JS aggregation off makes the JS files load via relative paths and function as intended.

Without any errors showing in my console or server logs I'm not sure I'm going to be able to get to the bottom of the AJAX issue, so for now a compromise seems to be to turn off aggregation for admin and content editing routes.

What would be the best way to do that? I know I can set $config['system.performance']['js']['preprocess'] = FALSE; and presumably a similar config key for AdvAgg's own setting (we have AdvAgg set to optimise/compress JS, so even with system.performance.js.preprocess turned off AdvAgg will still manage the files and use absolute paths to include them. Can config settings be altered on a per route/path basis?

  • Have you tried the Advanced CSS/JS Aggregation permission and/or ?advagg=0 ? I believe they are disabling aggregation.
    – GiorgosK
    Commented Mar 23, 2019 at 16:32
  • HI @GiorgosK, as well as disabling AdvAgg I also need to disable Core's aggregation too, so I don't think the permission or query string based approach is enough. Commented Mar 24, 2019 at 17:21

2 Answers 2


So, the issue I describe in my question is this Drupal Core issue: Drupal.ajax does not guarantee that "add new JS file to page" commands have finished before calling said JS

So, my solution wasn't to disable the aggregation, but to apply the latest patch provided in the issue on Drupal.org

  • 1
    Woah! Thank you! Glad Google brought me here. I had a bug were CKEditor wouldn't work in certain Ajaxified situations and I was close to simply find a way to exclude it from core aggregation. This patch fixed it for me. I love you 🤩
    – leymannx
    Commented Jul 28, 2022 at 19:08

We have two options:

Option 1: Disable advagg for admin routes: https://www.drupal.org/project/advagg/issues/3226448

Option 2: [PP-1] Drupal.ajax does not guarantee that "add new JS file to page" commands have finished before calling said JS: https://www.drupal.org/project/drupal/issues/1988968

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.