Bug 27050 - Allow multiple category_codes in delete_patrons.pl
Summary: Allow multiple category_codes in delete_patrons.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Timothy Alexis Vass
QA Contact: Marcel de Rooy
URL:
Keywords: Manual
Depends on:
Blocks: 28001
  Show dependency treegraph
 
Reported: 2020-11-18 13:16 UTC by Timothy Alexis Vass
Modified: 2021-12-13 21:13 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement allows the use of multiple patron category codes in the delete_patrons.pl script. For example, delete_patrons.pl --category_code PT --category_code ST
Version(s) released in:
21.05.00
Circulation function:


Attachments
Bug 27050 - Allow multiple category_codes in delete_patrons.pl (7.00 KB, patch)
2020-11-27 13:22 UTC, Timothy Alexis Vass
Details | Diff | Splinter Review
Bug 27050 - Allow multiple category_codes in delete_patrons.pl (7.04 KB, patch)
2020-12-02 10:56 UTC, David Nind
Details | Diff | Splinter Review
Bug 27050 - Allow multiple category_codes in delete_patrons.pl (7.14 KB, patch)
2021-01-29 09:41 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 27050: Allow multiple category_codes in delete_patrons.pl (7.10 KB, patch)
2021-02-08 14:26 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Alexis Vass 2020-11-18 13:16:53 UTC
overdue_notices.pl allows a list with branch codes.
Allow similiar functionality for category codes in delete_patrons.pl
Comment 1 Timothy Alexis Vass 2020-11-25 13:54:57 UTC
To clarify, overdue_notices.pl allows the option -library <branchcode> multiple times.
This is about allowing multiple --category_code <categorycode> in delete_patrons.pl
Comment 2 Timothy Alexis Vass 2020-11-27 13:22:08 UTC
Created attachment 114042 [details] [review]
Bug 27050 - Allow multiple category_codes in delete_patrons.pl

This patch allows multiple --category_code <categorycode> in delete_patrons.pl

The t/db_dependent/Members.t test has 2 added testcases with multiple category_code.

To test:
1) Run the test: prove -l . -v t/db_dependent/Members.t
2) This requires records in the database with at least two category codes. For example PT and ST.
3) Run the script: delete_patrons.pl --category_code PT
4) Confirm the number of patrons that would have been deleted.
5) Run the script: delete_patrons.pl --category_code PT --category-code ST
6) Confirm the number of patrons that would have been deleted.
7) Sign Off

Sponsored-by: Lunds Universitetsbibliotek
Comment 3 David Nind 2020-12-02 10:56:01 UTC
Created attachment 114094 [details] [review]
Bug 27050 - Allow multiple category_codes in delete_patrons.pl

This patch allows multiple --category_code <categorycode> in delete_patrons.pl

The t/db_dependent/Members.t test has 2 added testcases with multiple category_code.

To test:
1) Run the test: prove -l . -v t/db_dependent/Members.t
2) This requires records in the database with at least two category codes. For example PT and ST.
3) Run the script: delete_patrons.pl --category_code PT
4) Confirm the number of patrons that would have been deleted.
5) Run the script: delete_patrons.pl --category_code PT --category_code ST
6) Confirm the number of patrons that would have been deleted.
7) Sign Off

Sponsored-by: Lunds Universitetsbibliotek

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2020-12-02 10:59:25 UTC
Note that step 5 should be:

5) Run the script: delete_patrons.pl --category_code PT --category_code ST

The last category_code was category-code in the original test plan, with that you get 'Unknown option: category-code' error when running.

Everything then works as per the test plan.
Comment 5 Marcel de Rooy 2021-01-29 09:41:44 UTC
Created attachment 116012 [details] [review]
Bug 27050 - Allow multiple category_codes in delete_patrons.pl

This patch allows multiple --category_code <categorycode> in delete_patrons.pl

The t/db_dependent/Members.t test has 2 added testcases with multiple category_code.

To test:
1) Run the test: prove -l . -v t/db_dependent/Members.t
2) This requires records in the database with at least two category codes. For example PT and ST.
3) Run the script: delete_patrons.pl --category_code PT
4) Confirm the number of patrons that would have been deleted.
5) Run the script: delete_patrons.pl --category_code PT --category-code ST
6) Confirm the number of patrons that would have been deleted.
7) Sign Off

Sponsored-by: Lunds Universitetsbibliotek

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2021-01-29 10:02:43 UTC
Only forgot this warn:
Commit title does not start with 'Bug XXXXX: ' - 363fec6ca0
Comment 7 Jonathan Druart 2021-02-08 14:26:21 UTC
Created attachment 116503 [details] [review]
Bug 27050: Allow multiple category_codes in delete_patrons.pl

This patch allows multiple --category_code <categorycode> in delete_patrons.pl

The t/db_dependent/Members.t test has 2 added testcases with multiple category_code.

To test:
1) Run the test: prove -l . -v t/db_dependent/Members.t
2) This requires records in the database with at least two category codes. For example PT and ST.
3) Run the script: delete_patrons.pl --category_code PT
4) Confirm the number of patrons that would have been deleted.
5) Run the script: delete_patrons.pl --category_code PT --category-code ST
6) Confirm the number of patrons that would have been deleted.
7) Sign Off

Sponsored-by: Lunds Universitetsbibliotek

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Jonathan Druart 2021-02-08 16:04:56 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 9 Fridolin Somers 2021-02-12 14:26:12 UTC
Enhancement not pushed to 20.11.x