0

I have installed "Advanced CSS/JS Aggregation" on my Drupal 10. but after installation, I faced a problem.

In performance page, when I want to save configuration (for example I checked/Unchecked Aggregate CSS files & Aggregate JavaScript files checkboxes and want to update config.), I see this error

 'stale_file_threshold' is not a supported key. 

I tried to check aggregator settings. but I found no solution. I replaced alpha version with .dev version. but problem hasn't gone. Even I uninstalled and remove the module, but problem still exists and I can't save performance configuration.

what is your solution?

error when I want to save configurationDrupal

3
  • 1
    I’m voting to close this question because it is a reported bug on that project rather than a question: drupal.org/project/advagg/issues/3410820
    – mona lisa
    Commented Dec 26, 2023 at 0:25
  • Der @ciIefen. I created that topic myself and reported the problem. but it seems people in Stack-Exchange are more activated rather than Drupal.org. So I decided to ask my question here. I am still searching for a solution but nothing. Also all I know is about Drupal 7. I am amateur in Drupal 10 and I am trying to increase my level and skill in Drupal 10.
    – Mehrdad201
    Commented Dec 26, 2023 at 7:14
  • Sorry but bug reports are off topic here, specifically because they split the support away from where it needs to happen to benefit most people. Case in point, this has been answered here, and, while not difficult to debug, that debugging now isn’t in the module’s issue queue, where the maintainers can see it, confirm it, and easily release a patch for it. The best one could hope for is duplicating the information, which is bad. This isn’t an ideal outcome for the community, as you can imagine
    – Clive
    Commented Dec 27, 2023 at 14:55

1 Answer 1

2

The issue is in the Advanced CSS/JS Aggregation module that, in its SettingsForm::submitForm() method, sets the stale_file_threshold value in the system.performance configuration object.

$this->config('system.performance')
  ->set('stale_file_threshold', $form_state->getValue('stale_file_threshold'))
  ->set('css.gzip', $form_state->getValue('css_gzip'))
  ->set('js.gzip', $form_state->getValue('js_gzip'))
  ->save();

Drupal core validates the configuration objects with schema files like system.schema.yml; since stale_file_threshold is not defined in that file, Drupal reports an error.

This can only be fixed by the project maintainers. The module should not write a configuration value the System module does not recognize in its configuration object.
It is fine to change the css.gzip and the js.gzip values because the configuration schema defines both of them, but adding new values just causes errors like the one you saw.

2
  • 1
    Thanks. so in your idea we have to wait for new update? what is your solution to fix this issue at this time on my project?
    – Mehrdad201
    Commented Dec 26, 2023 at 19:39
  • 1
    The only solution would be changing the module code, but I would rather not do that. It would require to change more files in the module, at least because the configuration value should still be stored in a configuration object provided by the module.
    – avpaderno
    Commented Dec 27, 2023 at 10:59

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