Bug 23301

Summary: Borrower messaging preferences lost when duplicating patron and changing category
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, karen.fellows, kyle.m.hall, lisettepalouse+koha, magnus
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Andrew Fuerste-Henry 2019-07-11 12:38:33 UTC
To test:
- Create a patron and set their messaging preferences to something other than the defaults
- Duplicate the patron
- Note that their messaging preferences have been maintained
- Before saving the new patron, change their category
- Note that their messaging preferences reset to the default for their new category
Comment 1 Karen Fellows 2019-07-11 12:45:05 UTC
When creating cards for a family it is great to use the duplicate feature.  However, when you change categories--for example, adult to juvenile--it resets the messaging preferences to the default, but it keeps all other information from the parent card.  It would be great to have it truly duplicate the card will all messaging preferences.
Comment 2 Katrin Fischer 2020-10-18 17:09:49 UTC
Hm, I think me might not get a clear vote here on if that is intended behaviour or not. I would have expected the messaging defaults to reset when resetting the category, while you expect it to remain unchanged.

I am not sure how we could deal with this the best way. Should we have a pop-up asking about resetting the messaging preferences when the category is changed so it can be decided on an individual basis?
Comment 3 Magnus Enger 2021-01-29 14:02:04 UTC
(In reply to Katrin Fischer from comment #2)
> Hm, I think me might not get a clear vote here on if that is intended
> behaviour or not. I would have expected the messaging defaults to reset when
> resetting the category, while you expect it to remain unchanged.
> 
> I am not sure how we could deal with this the best way. Should we have a
> pop-up asking about resetting the messaging preferences when the category is
> changed so it can be decided on an individual basis?

There is also the update_patrons_category.pl (formerly known as j2a.pl) cronjob - changing categories is not always an interactive process. 
https://git.koha-community.org/Koha-community/Koha/src/branch/master/misc/cronjobs/update_patrons_category.pl
Comment 4 Katrin Fischer 2021-01-31 14:57:35 UTC
(In reply to Magnus Enger from comment #3)
> (In reply to Katrin Fischer from comment #2)
> > Hm, I think me might not get a clear vote here on if that is intended
> > behaviour or not. I would have expected the messaging defaults to reset when
> > resetting the category, while you expect it to remain unchanged.
> > 
> > I am not sure how we could deal with this the best way. Should we have a
> > pop-up asking about resetting the messaging preferences when the category is
> > changed so it can be decided on an individual basis?
> 
> There is also the update_patrons_category.pl (formerly known as j2a.pl)
> cronjob - changing categories is not always an interactive process. 
> https://git.koha-community.org/Koha-community/Koha/src/branch/master/misc/
> cronjobs/update_patrons_category.pl

Good point. We could make it a CLI option there, but it would need to be a hard default.