Closed (fixed)
Project:
EU Cookie Compliance (GDPR Compliance)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 May 2018 at 07:57 UTC
Updated:
22 Jul 2018 at 15:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hitfactory commentedAs far as I understand there is no way to delete items from the cache matching a wildcard pattern like js:% in the original bit of code.
Here's a first pass at a patch which instead calls invalidateTags on items with the tag 'library_info'.
This prevents the error but will also invalidate cache items like css:%.
Comment #3
svenryen commentedThis sounds like a very good idea, thanks for the patch. Could you get somebody to RTBC this issue? I have no capacity to look at this until late June, due to GDPR issues and vacation.
Comment #4
hitfactory commentedOf course, it always helps to have Redis enabled on the server you're testing the patch on. :)
This patch actually prevents the original error instead of creating a new one!
I'm not entirely sure this the right approach but it at least prevents the error while May 25 looms ever closer.
So happy to leave it here until others weigh in.
Comment #6
it-cruSame problem with memcache as CacheBackend. Applied patch from #2 and now form is saved without an error.
@hitfactory: Which new error do you mean between patch #2 and #4 ?
Comment #7
hitfactory commentedWith the patch in #2, I started getting the following error
Error: Call to undefined method Drupal\redis\Cache\Predis::invalidateTags() in /app/web/modules/contrib/eu_cookie_compliance/src/Form/EuCookieComplianceConfigForm.php on line 761
The invalidateTags method invalidates tags across all bins, hence the switch to Cache::invalidateTags() which Redis doesn't choke on.
Attached is a re-roll for latest dev which you can test with Memcache.
Comment #8
it-cruPatch from #7 also works for memcache backend. First I was confused using directly Cache::invaidateTags, but this is also provided in other docs. Set status of issue to 'Needs review'.
Comment #9
svenryen commentedI tested the patch both with and without Redis installed, and this seems to be a better way of invalidating cache than what was suggested in #2978326: Query on EuCookieComplianceConfigForm to cache table. Applying this one to -dev
Comment #11
svenryen commented