Bug 21081

Summary: There is no check that patron is guarantor when batch deleting
Product: Koha Reporter: Sophie MEYNIEUX <sophie.meynieux>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle.m.hall
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 Sophie MEYNIEUX 2018-07-17 08:17:43 UTC
When deleting one patron (members/deletemem.pl), Koha checks that patron is not a guarantor, else it does not allow deletion.

But in tools > batch patron deletion (tools/borrowers.pl or misc/cronjobs/delete_patrons.pl), this check is not performed, so there is a lot of borrowers with guarantorid that does not exist any more.
Check if patron is a guarantor should be performed in all cases of deletion.
Comment 1 Sophie MEYNIEUX 2018-07-17 14:41:29 UTC
It seems that check is done in GetBorrowersToExpunge function

So I don't understand why there is so many borrowers with unknown guarantorid in our databases