Summary: | Add ability to pass a file of borrowernumbers for deletion to delete_patrons.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | Command-line Utilities | Assignee: | Rogan Hamby <rogan.hamby> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | 1joynelson, jonathan.druart, martin.renvoize, robin, rogan.hamby |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
Adds the ability to specify a file with the --file flag that
should be a list of borrowernumbers for deletion.
If used without other flags it will delete the list of borrowers, if used with other flags it will treat the other criteria as filters for the list.
|
Version(s) released in: |
20.05.00
|
Circulation function: | |||
Attachments: |
Bug 18414 allow delete_patrons.pl to use a list of borrowernumbers
Bug 18413: Allow to use other select criteria with delete_patrons.pl Bug 18413: Allow to use other select criteria with delete_patrons.pl |
Description
Katrin Fischer
2017-04-11 13:32:58 UTC
Created attachment 94015 [details] [review] Bug 18414 allow delete_patrons.pl to use a list of borrowernumbers Small patch to allow use of borrowernumbers in a text file for deletion. If used with filters specified they act as filters on the contents of the file. Created attachment 96574 [details] [review] Bug 18413: Allow to use other select criteria with delete_patrons.pl Adds the ability to specify a file with the --file flag that should be a list of borrowernumbers for deletion. If used without other flags it will delete the list of borrowers, if used with other flags it will treat the other criteria as filters for the list. To Test: 1) Specify a list, e.g. borrowers.txt, of borrowernumbers in the database and put them in a text file with one per line 2) Invoke the script like ./delete_patrons.pl --file borrowers.txt to delete those patrons 3) Populate the list with a mix of borrowers in a category and those not, say categoryfoo 4) Invoke the scirpt as ./delete_patrons.pl --category_code categoryfoo --file borrowers.txt 5) Only the borrowers in the file that have the specified category will be deleted Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> I did not test but reading the code I think that there could be an expected behaviors if you pass --file with another criteria but GetBorrowersToExpunge returns an empty list => Patrons from the file will be deleted Forget that last comment, it does not. You are testing for !defined $members and GetBorrowersToExpunge will always return an arrayref. I would prefer to see the code improved and more robust to avoid such regressions if we modify the return value. I cannot think of something right now, leaving for another QAer or will come back later to this. Created attachment 101116 [details] [review] Bug 18413: Allow to use other select criteria with delete_patrons.pl Adds the ability to specify a file with the --file flag that should be a list of borrowernumbers for deletion. If used without other flags it will delete the list of borrowers, if used with other flags it will treat the other criteria as filters for the list. To Test: 1) Specify a list, e.g. borrowers.txt, of borrowernumbers in the database and put them in a text file with one per line 2) Invoke the script like ./delete_patrons.pl --file borrowers.txt to delete those patrons 3) Populate the list with a mix of borrowers in a category and those not, say categoryfoo 4) Invoke the scirpt as ./delete_patrons.pl --category_code categoryfoo --file borrowers.txt 5) Only the borrowers in the file that have the specified category will be deleted Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> https://bugs.koha-community.org/show_bug.cgi?id=18414 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Nice work everyone! Pushed to master for 20.05 enhancement not backported to 19.11.x |