Bug 30177

Summary: When changing patron categories of existing accounts it should not reset message prefs without warning
Product: Koha Reporter: Lucas Gass <lucas>
Component: PatronsAssignee: Lucas Gass <lucas>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, kyle
Version: masterKeywords: Manual, release-notes-needed
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30238
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.05
Attachments: Bug 30177: When editing an existing patron set message_prefs_dirty to true
Bug 30177: When editing an existing patron set message_prefs_dirty to true
Bug 30177: When editing an existing patron set message_prefs_dirty to true

Description Lucas Gass 2022-02-24 15:37:14 UTC
To recreate:

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 

There should be a warning to staff that messaging prefs are being changed.
Comment 1 Lucas Gass 2022-02-24 16:21:46 UTC
Created attachment 131067 [details] [review]
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.
Comment 2 Owen Leonard 2022-03-03 17:30:30 UTC
Created attachment 131342 [details] [review]
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.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Katrin Fischer 2022-03-06 14:24:13 UTC
I am sorry, patch applied, restart_all and did a couple of reloads... but I can't get the warning to trigger. :(

Not sure if this is also a separate bug: When the defaults are changed, the digest option although added for the patron category is not checked.

The age warning might also upset things a bit, but I tried without that and still no luck.

Testing in Firefox on Ubuntu.
Comment 4 Katrin Fischer 2022-03-06 14:26:05 UTC
Sometimes... as soon as I had sent my comment, it started working. Including the digest option.
Comment 5 Katrin Fischer 2022-03-06 14:30:58 UTC
Ok, this is the thing:

* Updated setting for patron category staff, checking Item due with digest.
* Apply patch, reload and restart all the things.
* Edit 'Nicole Schneider'
* Set patron category to 'staff'
* Accept changes to default with OK
* Verify: The digest option appears checked, but greyed out.
* Save
* Edit patron again - the digest option is not set

I'll file this as a new bug, as it happens without the patch set too :(

Passing QA here meanwhile.
Comment 6 Katrin Fischer 2022-03-06 14:34:11 UTC
Created attachment 131417 [details] [review]
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.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Fridolin Somers 2022-03-17 21:23:52 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 8 Kyle M Hall 2022-03-25 13:28:20 UTC
Pushed to 21.11.x for 21.11.05