From 5e40d52e668473f7862434770cffc3f203662345 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 24 Feb 2022 16:17:11 +0000 Subject: [PATCH] Bug 30177: When editing an existing patron set message_prefs_dirty to true 1 - Define default messaging preferences for a patron category 2 - Go into an existing account and change the patron category to the one set in step 1. 3 - Confirm that the messaging prefs have been reset to that of the default patron category 4 - Apply patch 5 - Repeat Step 2, this time you should see a warning asking if you want to set messaging prefs to the category default 6 - Press OK and save. Confirm that the messaging prefs are now set to the default for that category 7 - Try it again with an existing account and press Cancel this time. Notice that there should be no change to the patron messaging prefs. 8 - Try making a new patron and switching the category, you should see no warning and the message prefs should be proberly set to the defaults of any category you choose. --- koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js index 3babbbd1f2..4c95d9042b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js +++ b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js @@ -6,6 +6,10 @@ $(document).ready(function(){ message_prefs_dirty = true; }); + if ( window.location.href.indexOf("op=add") === -1 ) { + message_prefs_dirty = true; // unless op=add consider the message prefs dirty + } + if( $("#messaging_prefs_loading").length ){ // This element only appears in the template if op=add $('#categorycode_entry').change(function() { var messaging_prefs_loading = $("#messaging_prefs_loading"); -- 2.20.1