summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsvenryen2018-02-25 13:58:33 (GMT)
committerSven Berg Ryen2018-02-25 13:58:33 (GMT)
commit0ce110af6244d47a65f3e93e0b6c480971ae603b (patch)
tree78c8118f8e04b8ec6629b1de322a2c5ec60c3697
parentd9636fa81c1a48ec2aa5a1e658ffd11e35206e30 (diff)
Issue #2899095 by svenryen: Banner behaviour for "Consent by clicking" is opposite of what's been set in the admin interface
-rw-r--r--eu_cookie_compliance.install13
-rw-r--r--js/eu_cookie_compliance.js2
2 files changed, 14 insertions, 1 deletions
diff --git a/eu_cookie_compliance.install b/eu_cookie_compliance.install
index f6eb204..995b370 100644
--- a/eu_cookie_compliance.install
+++ b/eu_cookie_compliance.install
@@ -17,3 +17,16 @@ function eu_cookie_compliance_update_8101() {
->getEditable('eu_cookie_compliance.settings')
->set('cookie_lifetime', 100)->save();
}
+
+/**
+ * Reverse the setting for "Consent by clicking" (solving a module beta bug).
+ */
+function eu_cookie_compliance_update_8102() {
+ $consent_by_clicking_value = \Drupal::configFactory()
+ ->get('eu_cookie_compliance.settings')
+ ->get('popup_clicking_confirmation');
+ \Drupal::configFactory()
+ ->getEditable('eu_cookie_compliance.settings')
+ ->set('popup_clicking_confirmation', !$consent_by_clicking_value)->save();
+}
+
diff --git a/js/eu_cookie_compliance.js b/js/eu_cookie_compliance.js
index 00c6099..89743db 100644
--- a/js/eu_cookie_compliance.js
+++ b/js/eu_cookie_compliance.js
@@ -31,7 +31,7 @@
if (status === 0) {
var next_status = 1;
- if (!clicking_confirms) {
+ if (clicking_confirms) {
$('a, input[type=submit], button[type=submit]').bind('click.eu_cookie_compliance', function () {
if (!agreed_enabled) {
Drupal.eu_cookie_compliance.setStatus(1);