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:
27 Apr 2018 at 15:08 UTC
Updated:
15 May 2018 at 11:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
svenryen commentedThanks for the bug report. I'll take a look at this today.
Comment #3
baikho commentedHi,
This caused by https://www.drupal.org/project/eu_cookie_compliance/issues/2955489
The
ConsentStorageManagerneeds to implement theFallbackPluginManagerInterface& implementgetFallbackPluginId()with the basic ConsentStorage plugin :)See added patch with fallback addition.
Comment #4
baikho commentedNext SQL err is caused when $
revision_idisFALSE:Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'revision_id' at row 1: INSERT INTO {eu_cookie_compliance_basic_consent} (uid, ip_address, timestamp, revision_id, consent_type) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => 192.168.88.1 [:db_insert_placeholder_2] => 1524931163 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => banner ) in Drupal\eu_cookie_compliance\Plugin\ConsentStorage\BasicConsentStorage->registerConsent() (line 43 of /var/www/html/xxxxxx/docroot/modules/contrib/eu_cookie_compliance/src/Plugin/ConsentStorage/BasicConsentStorage.php).See re-rolled patch with additional check before db insert in the
BasicConsentStorageplugin.Comment #5
svenryen commented@baik - thanks for the patch! I have one question: what happens by default, will it use the basic consent storage when no storage plugin is selected?
Comment #6
baikho commentedHi @svenryen,
Yes, it will default to the
BasicConsentStorageplugin. Although I think we may have another issue, as we have 2 conditions that need to be leveraged being both the consent method (1) & consent storage (2) default behaviours. The issue applies to theStoreConsentcontroller & the check if the consent storage is to be used at all:For this upon install, the
$consent_storage_methodis possibly NULL, which makes this check for storage usage implicit. What I think seems more right is to check explicitly for neitherNULLnordo_not_store?With this I believe, we additionally have the correct check in place in the controller. I've re-created the patch & updated the type hinting to
ConsentStorageInterfaceas well.Comment #7
svenryen commentedThe deafult behavior should be "Do not store", not "Basic". If this patch results in people getting logging enabled without being aware of it after the update, we can't do that. The table would grow far to quickly on a busy site.
I've tried various ways of reproducing today, and it seems the problem is more that I forgot to set a default setting for the consent_storage_method config variable. If that's set we won't have this problem.
Comment #8
baikho commented@svenryen, I see that does seem to get rid of the error indeed.
Comment #9
svenryen commentedI added the defaults to the patch provided and tested. Seems to work really well - nice work! Thanks for the contribution!
Comment #11
svenryen commented