From 36d0bd3c2491e4743cd4828fe1c726735304fa0f Mon Sep 17 00:00:00 2001 From: Brock Fanning Date: Tue, 10 Sep 2024 14:27:58 +0000 Subject: [PATCH 1/2] FOIA-0: Patch autologout to work with confirm_leave. --- composer.json | 3 +++ composer.lock | 8 ++++++-- patches/autologout-support-for-confirm_leave.patch | 13 +++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 patches/autologout-support-for-confirm_leave.patch diff --git a/composer.json b/composer.json index d463ea2d9..d2f23cd3c 100644 --- a/composer.json +++ b/composer.json @@ -205,6 +205,9 @@ }, "drupal/lightning_media": { "Issue 3456919 - Fixes error in github action test Drupal 10.3": "https://www.drupal.org/files/issues/2024-07-12/mapping-definition-entity-browser-upload-validators-3456919.patch" + }, + "drupal/autologout": { + "Avoid problematic interactions with the confirm_leave module": "./patches/autologout-support-for-confirm_leave.patch" } }, "installer-types": [ diff --git a/composer.lock b/composer.lock index d5517da4f..84bd7fe24 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b62fbbf3fb73a7d6fb66e0a526bbbdcf", + "content-hash": "f983d31daec3ac88e97956d3522948d6", "packages": [ { "name": "acquia/blt", @@ -2894,7 +2894,7 @@ ], "authors": [ { - "name": "AjitS", + "name": "ajits", "homepage": "https://www.drupal.org/user/981944" }, { @@ -2937,6 +2937,10 @@ "name": "prabeen.giri", "homepage": "https://www.drupal.org/user/913078" }, + { + "name": "scott_earnest", + "homepage": "https://www.drupal.org/user/416158" + }, { "name": "str8", "homepage": "https://www.drupal.org/user/2865063" diff --git a/patches/autologout-support-for-confirm_leave.patch b/patches/autologout-support-for-confirm_leave.patch new file mode 100644 index 000000000..ef5debf6e --- /dev/null +++ b/patches/autologout-support-for-confirm_leave.patch @@ -0,0 +1,13 @@ +diff --git a/js/autologout.js b/js/autologout.js +index ca3fe7e..fe91a7b 100644 +--- a/js/autologout.js ++++ b/js/autologout.js +@@ -196,6 +196,8 @@ + } + + function logout() { ++ // Reset forms so that the confirm_leave module doesn't interfere. ++ $('form').removeClass('form-updated'); + if (localSettings.use_alt_logout_method) { + let logoutUrl = drupalSettings.path.baseUrl + "autologout_alt_logout"; + triggerLogoutEvent('alternative', logoutUrl); From a10b0965dd909242ffc717f9e70fdc33e3d74d7a Mon Sep 17 00:00:00 2001 From: Brock Fanning Date: Tue, 10 Sep 2024 14:47:00 +0000 Subject: [PATCH 2/2] FOIA-0: Avoid problem with autologout and confirm_leave. --- patches/autologout-support-for-confirm_leave.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/autologout-support-for-confirm_leave.patch b/patches/autologout-support-for-confirm_leave.patch index ef5debf6e..07fa20080 100644 --- a/patches/autologout-support-for-confirm_leave.patch +++ b/patches/autologout-support-for-confirm_leave.patch @@ -1,13 +1,13 @@ diff --git a/js/autologout.js b/js/autologout.js -index ca3fe7e..fe91a7b 100644 +index ca3fe7e..8c0a4a9 100644 --- a/js/autologout.js +++ b/js/autologout.js @@ -196,6 +196,8 @@ } function logout() { -+ // Reset forms so that the confirm_leave module doesn't interfere. -+ $('form').removeClass('form-updated'); ++ // Prevent the confirm_leave module from interfering. ++ window.onbeforeunload = function () {}; if (localSettings.use_alt_logout_method) { let logoutUrl = drupalSettings.path.baseUrl + "autologout_alt_logout"; triggerLogoutEvent('alternative', logoutUrl);