Bug 32195

Summary: Add option to update_patrons_category cron to remove guarantors when patrons move to category that does not allow guarantors
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, gmcharlt, josefine.m.gustavsson, jswink, kyle.m.hall, lisette, patrick.robitaille, wizzyrea
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32196
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39233
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 12446    
Bug Blocks:    

Description Andrew Fuerste-Henry 2022-11-14 16:47:14 UTC
To recreate:
1: have a patron category where CanBeGuarantee is set to Yes.
2: Create a patron in that category, give them a guarantor
3: edit the patron category to set CanBeGuarantee to No
4: confirm your patron still has a guarantor that shows on the details page, but the guarantor no longer shows on the edit screen
5: this means the guarantor cannot be removed :(

I see a few ways to move forward. We could:
- make Koha go find and remove relationships right away when a category is updated
- provide a script that could be run/cronned to find and delete relationships from the command line
Comment 1 Liz Rea 2023-10-27 14:39:19 UTC
I think we just need to always show the "remove" link no matter what the category says - if there is a guarantor we at least need to be able to remove it. The main problem here being that we are editing the category underneath an existing patron and the settings aren't retroactive to patrons who now don't fit the defined category.
Comment 2 Justin Swink 2024-07-26 15:08:14 UTC
I agree with Liz. Having it set to always show "remove" would be best.
Comment 3 Andrew Fuerste-Henry 2025-02-28 15:28:47 UTC
I'm renaming and re-focusing this bug to specifically a flag on the update_patrons_category script to automatically remove guarantors when a patron moves into a category that does not allow guarantors.

Bug 32196 suggests that the staff interface always show and allow removal of a guarantor if one exists, regardless of patron category. That would handle the manual side of this issue.