Problem/Motivation
When updating matomo but not drupal/core, the JavaScript cache-busting parameter remains the same (e.g. ?v=10.4.8). When updating drupal/core but not matomo, the JavaScript cache-busting parameter changes.
LibraryDiscoveryParser applies the Drupal version to every library that uses version: VERSION. It does not use the modules version.
If the version is omitted, the content of referenced CSS/JS files is utilized in the hash.
Steps to reproduce
First case
- Use matomo 1.24, use drupal/core 10.4.8
- Disable JS preprocessing
$config['system.performance']['js']['preprocess'] = FALSE; - Look at sites source code and see
<script src="/modules/contrib/matomo/js/matomo.js?v=10.4.8"></script> - Update matomo to 1.25
- Look at sites source code and see
<script src="/modules/contrib/matomo/js/matomo.js?v=10.4.8"></script>
Second case
- Use matomo 1.25, use drupal/core 10.4.7
- Disable JS preprocessing
$config['system.performance']['js']['preprocess'] = FALSE; - Look at sites source code and see
<script src="/modules/contrib/matomo/js/matomo.js?v=10.4.7"></script> - Update drupal/core to 10.4.8
- Look at sites source code and see
<script src="/modules/contrib/matomo/js/matomo.js?v=10.4.8"></script>
Proposed resolution
Remove version: VERSION from matomo.libraries.yml
Issue fork matomo-3537836
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
hosterholzComment #4
hosterholzComment #5
grimreaperComment #8
grimreaper