[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] cookies: In dialog mode prevent dismissing the modal
"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]> Wed, 15 Jul 2026 17:31:55 +0000
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a57c40b7e421_3819c94034881@gitlab-sidekiq-low-urgency-cpu-bound-v2-56b6659d64-vhw2c.mail> |
Jonny Bradley pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
6cac0501 by Jonny Bradley at 2026-07-15T17:13:42+00:00
[FIX] cookies: In dialog mode prevent dismissing the modal
---
* [FIX] cookies: In dialog mode, setting the background as static (to prevent closing the dialog without clicking one of the buttons) was dependent on the `cookie_consent_disable` pref, which wasn't being added to the jqueryTiki object, so fixed that.
However, as i understand it, it was operating back to front, so i switched the logic, and now you can "dismiss" the modal only when `cookie_consent_disable=y`.
This pref's behaviour has changed following the mammoth revamp in MR !5263 and now doesn't quite make sense imho
See merge request tikiwiki/tiki!10727
- - - - -
2 changed files:
- lib/setup/javascript.php
- src/js/jquery-tiki/tiki-cookie-handler.js
Changes:
=====================================
lib/setup/javascript.php
=====================================
@@ -247,6 +247,7 @@ if (! timezone) {
$jqueryTiki['cookie_consent_dom_id'] = $prefs['cookie_consent_dom_id'];
$jqueryTiki['cookie_consent_mode'] = $prefs['cookie_consent_mode'];
$jqueryTiki['cookie_consent_expires'] = $prefs['cookie_consent_expires'];
+ $jqueryTiki['cookie_consent_disable'] = $prefs['cookie_consent_disable'] === "y";
$jqueryTiki['cookie_consent_name'] = CookieConsentLib::COOKIE_CONSENT_NAME;
$jqueryTiki['cookie_consent_categories'] = json_encode(array_keys(CookieConsentLib::getRequestedCookieCategories()));
$jqueryTiki['cookie_consent_value'] = json_encode(CookieConsentLib::getConsentPreferences(), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
=====================================
src/js/jquery-tiki/tiki-cookie-handler.js
=====================================
@@ -166,8 +166,8 @@ $(document).ready(() => {
setTimeout(() => {
const cookieDialogElement = $(`#${jqueryTiki.cookie_consent_dom_id}`);
cookieDialogElement.modal({
- backdrop: jqueryTiki.cookie_consent_disable === "y" ? "static" : true,
- keyboard: jqueryTiki.cookie_consent_disable === "y" ? false : true,
+ backdrop: jqueryTiki.cookie_consent_disable ? true : "static",
+ keyboard: !jqueryTiki.cookie_consent_disable,
});
cookieDialogElement.modal("show").css({
backgroundColor: "transparent",
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/6cac050105e6c7ffb3560283cdd7bcc840172bc6
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/6cac050105e6c7ffb3560283cdd7bcc840172bc6
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs