I think it is to defeat caching that Ubercart appends a ?get=parameter to paths of some js files it references.
javascript_aggregator (1) fails to find such js files (e.g. ../uc_cart.js?03423), (2) should at least exclude such files from aggregation in good faith.
Attached is a patch. A regexp was modified to fail match against javascript file urls that contain get parameters. This does not however solve javascript_aggregator's Ubercart compatibility.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | yh.patch | 1.05 KB | yhager |
| #2 | js_agg_query_truncate.patch | 1.58 KB | gábor hojtsy |
| js_aggregator_sane_exclusion.patch | 786 bytes | k8n |
Comments
Comment #1
lmakarovYou can just ignore/remove the GET parameter. The file will be aggregated and will work fine.
Comment #2
gábor hojtsyStumbled on the same issue with Ubercart. I'd suggest to remove these URL tricks, since javascript_aggregator users should be accustomed to clearing their JS cache on site upgrades. Here is a suggested patch. Without this fixed, the module breaks badly on pages using ubercart, since it thinks the files were added but they were not.
Alternatively we could also do a !file_exists() check and add the script back to the $scripts_js_links if the file was not there (eg. it contained a ? argument), but that would also make us keep 404 references in JS files, which are a good thing to remove as a side effect of this patch IMHO.
Issue still exists in the 5.x-1.5 version, so setting that.
Comment #3
gábor hojtsyAlso, retitling for a hopefully better summary.
Comment #4
derjochenmeyer commentedThanks for the patch! http://drupal.org/cvs?commit=215436
Comment #6
yhager commentedI think the patch was wrongly applied. The current state of the module is that every file is included twice - once as is, and another with paramteres removed.
The current code has:
the first two lines need be removed (as was is the original patch posted in #2.
Patch attached.
Comment #7
derjochenmeyer commentedCommited: http://drupal.org/cvs?commit=353776
Thanks!