Bug 37341

Summary: Koha should warn of circular invalid guarantor relationships
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Nick Clemens (kidclamp) 2024-07-12 12:33:09 UTC
To recreate:
1 - Define a patron category, say Juvenile, as "Can be guarantee"
2 - Find a patron in Juvenile category and assign a guarantor from Patron category
3 - Update Patron category as "Can be guarantee"
4 - View Juvenile patron, no warning
5 - Edit patron, see warning "A guarantor cannot be a guarantee."
5 - Enable "TrackLastPatronActivityTriggers" for checkin and checkout
6 - Checkout an item to the Juvenile, KO, "Child patron cannot be a guarantor."
7 - Checkin the item "Child patron cannot be a guarantor."

In KTD we get a stack trace, in production we were seeing an error "Item not checked in. Check the about page (Child patron cannot be a guarantor.)

We should add a warning on the child patrons details and checkout screen, and possibly add a test on the about page

Possibly we should not allow the category to be updated if any existing patrons are guarantors already