From 34df0bf40b000b1e60aefdc0ba2fb13cf6452908 Mon Sep 17 00:00:00 2001
From: Julian Pustkuchen <3110-Anybody@users.noreply.drupalcode.org>
Date: Wed, 18 Dec 2024 10:33:29 +0000
Subject: [PATCH 1/2] Update SettingsForm.php: Fix form states.

---
 src/Form/SettingsForm.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Form/SettingsForm.php b/src/Form/SettingsForm.php
index e2f0f87..d93362f 100644
--- a/src/Form/SettingsForm.php
+++ b/src/Form/SettingsForm.php
@@ -106,7 +106,7 @@ class SettingsForm extends ConfigFormBase {
       '#required' => TRUE,
       '#states' => [
         'visible' => [
-          ':input[name="persistor"]' => ['!value' => ''],
+          ':input[name="persistor"]' => ['!value' => 'persistor_null'],
         ],
       ],
     ];
@@ -127,7 +127,7 @@ class SettingsForm extends ConfigFormBase {
       '#default_value' => $cookieExpireDefaultValue,
       '#states' => [
         'visible' => [
-          ':input[name="persistor"]' => ['value' => 'cookie'],
+          ':input[name="persistor"]' => ['value' => 'persistor_cookie'],
         ],
       ],
     ];
-- 
GitLab


From 7357f647c3746e7dced24843f72cec7fbe744472 Mon Sep 17 00:00:00 2001
From: Julian Pustkuchen <3110-Anybody@users.noreply.drupalcode.org>
Date: Wed, 18 Dec 2024 10:35:34 +0000
Subject: [PATCH 2/2] Update persistent_visitor_parameters.install

---
 persistent_visitor_parameters.install | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/persistent_visitor_parameters.install b/persistent_visitor_parameters.install
index 4a0ce72..523c8b1 100644
--- a/persistent_visitor_parameters.install
+++ b/persistent_visitor_parameters.install
@@ -60,9 +60,13 @@ function persistent_visitor_parameters_update_10003() {
  */
 function persistent_visitor_parameters_update_10004() {
   $config = \Drupal::configFactory()->getEditable('persistent_visitor_parameters.settings');
+  // Update new keys:
   $config->set('persistor', 'persistor_cookie')
     ->set('persistor_key', 'pvp_stored_variables')
     ->set('persistor_expire', $config->get('cookie_expire'))
     ->set('respect_dnt', empty($config->get('dont_respect_dnt')))
+    // Remove old keys
+    ->clear('cookie_expire')
+    ->clear('dont_respect_dnt')
     ->save();
 }
-- 
GitLab