Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Cookie notification not working when merging js #28

Open
ioweb-gr opened this issue Nov 24, 2018 · 2 comments
Open

[bug] Cookie notification not working when merging js #28

ioweb-gr opened this issue Nov 24, 2018 · 2 comments

Comments

@ioweb-gr
Copy link
Contributor

When I enable js merging the cookie notification is not working. It's trying to find two files in
/media/js/lang/tarteaucitron.[lang].js
and
/media/js/tarteaucitron.services.js
which of course do not exist because css and js are merged.

Normally it requests them from
skin/frontend

But this causes a 404 and javascript errors

@bastienlm
Copy link
Contributor

Arf... it's hard to solve cleanly ^^
I think the best solution is to set 'tarteaucitronForceCDN' to skin directory.

var tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '/skin/frontend/base/default/js/ph/gdpr/tarteaucitron/' : tarteaucitronForceCDN;
in tarteaucitron.js
but if you override this file in your own skin directory, that not working :/ or you need to update this value/

@ioweb-gr
Copy link
Contributor Author

I will try and test this out and see if I can make something that will work consistently. Maybe something like this could work

  • Check if js merging is enabled in config
  • Get current skin package
  • Check if file exists in current skin package
  • If file exists in current skin package set tarteaucitronForceCDN else fallback to the base/default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants