[Bug 18414] New: Allow to use other select criteria with delete_patrons.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Bug ID: 18414 Summary: Allow to use other select criteria with delete_patrons.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: gmcharlt@gmail.com Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz It would be nice if the delete_patrons.pl script could be enhanced to also allow to delete patrons using a list of borrowernumbers from a file. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Rogan Hamby <rogan.hamby@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rogan.hamby@gmail.com Assignee|gmcharlt@gmail.com |rogan.hamby@gmail.com Status|NEW |Needs Signoff --- Comment #1 from Rogan Hamby <rogan.hamby@gmail.com> --- Created attachment 94015 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94015&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 96574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96574&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94015|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96574|0 |1 is obsolete| | --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 101116 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101116&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com --- Comment #7 from Joy Nelson <joy@bywatersolutions.com> --- enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Adds the ability to specify release notes| |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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Allow to use other select |Add ability to pass a file |criteria with |of borrowernumbers for |delete_patrons.pl |deletion to | |delete_patrons.pl CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18414 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|Adds the ability to specify |Adds the ability to specify release notes|a file with the --file flag |a file with the --file flag |that |that |should be a list of |should be a list of |borrowernumbers for |borrowernumbers for |deletion. |deletion. |If used without | |other flags it will delete |If used without |the list of borrowers, if |other flags it will delete |used with other flags it |the list of borrowers, if |will treat the other |used with other flags it |criteria as filters for the |will treat the other |list. |criteria as filters for the | |list. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org