In some cases we don't want borrowers / patrons not to be deleted if they have certain restrictions. Therefor we add a new parameter to the cronjob delete_patrons.pl (see manual https://koha-community.org/manual/latest/en/html/cron_jobs.html#batch-delete-patrons )
Created attachment 169688 [details] [review] Bug 37418: delete_patrons.pl: Exclude patrons with restrictions Add the option "--without_restriction_type" so that delete_patrons.pl does not delete patrons with given restriction types. To test: 1) Run misc/cronjobs/delete_patrons.pl --not_borrowed_since 2010-01-01 and choose a borrowernumber that would be deleted. 2) In your browser go to /cgi-bin/koha/members/moremember.pl?borrowernumber=<borrowernumber> and add a manual restriction to this patron. 3) Apply the patch. 4) Run misc/cronjobs/delete_patrons.pl --not_borrowed_since 2010-01-01 \ --without_restriction_type MANUAL 5) Check that the patron with the manual restriction would not be deleted. Sponsored-by: Karlsruhe Institute of Technology (KIT)
Created attachment 169879 [details] [review] Bug 37418: delete_patrons.pl: Exclude patrons with restrictions Add the option "--without_restriction_type" so that delete_patrons.pl does not delete patrons with given restriction types. To test: 1) Run misc/cronjobs/delete_patrons.pl --not_borrowed_since 2010-01-01 and choose a borrowernumber that would be deleted. 2) In your browser go to /cgi-bin/koha/members/moremember.pl?borrowernumber=<borrowernumber> and add a manual restriction to this patron. 3) Apply the patch. 4) Run misc/cronjobs/delete_patrons.pl --not_borrowed_since 2010-01-01 \ --without_restriction_type MANUAL 5) Check that the patron with the manual restriction would not be deleted. Sponsored-by: Karlsruhe Institute of Technology (KIT) Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Can there be a unit test added to cover the changes to GetBorrowersToExpunge?
(In reply to Lucas Gass (lukeg) from comment #3) > Can there be a unit test added to cover the changes to GetBorrowersToExpunge? Yes, I will add a unit test.
Created attachment 176777 [details] [review] Bug 37418: (follow-up) Add unit tests for GetBorrowersToExpunge() Add unit tests for testing the new parameter without_restriction_types of C4::Members::GetBorrowersToExpunge(). Sponsored-by: Karlsruhe Institute of Technology (KIT)