We have run into an issue with one of our sites which uses the Domain module, where the "Find more" button basically has the same link for different countries as the cache object ("eu_cookie_compliance_client_settings_*") is $theme and $language sensitive only.

For example if a user goes to example.com/ch/de (switzerland) and click the find out more button, they will be taken to example.com/ch/de/cookie-info page correctly.
However when another user visits example.com/de/de page and click the find out more button, they will also be taken to the example.com/ch/de/cookie-info page since the cache object only caches the user's language.

I have created a patch which tries to load the global $_domain variable, checks if the "domain_id" is set, and adds it as part of the cache object name.
So in the end the cache object name looks like:
'eu_cookie_compliance_client_settings_' . $theme . '_' . $current_domain . $language->language

While patching up all occurences of the cache name I have realised that the cache_clear_all function in the eu_cookie_compliance.admin.inc file hasn't worked since the $theme variable has been introduced in the cache object name as the line goes like this:
cache_clear_all('eu_cookie_compliance_client_settings_' . $language->language, 'cache');
So submitting the admin settings form would never clear the eu_cookie_compliance_client_settings_* caches.

Comments

oldspot created an issue. See original summary.

svenryen’s picture

Status: Active » Fixed

Thanks for the patch. This is added to -dev.

  • svenryen committed 686f483 on 7.x-1.x authored by oldspot
    Issue #2794137 by oldspot, svenryen: Make cache object name domain...
svenryen’s picture

Status: Fixed » Closed (fixed)