Bug 27050

Summary: Allow multiple category_codes in delete_patrons.pl
Product: Koha Reporter: Timothy Alexis Vass <timothy_alexis.vass>
Component: Command-line UtilitiesAssignee: Timothy Alexis Vass <timothy_alexis.vass>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, david, fridolin.somers, m.de.rooy, robin, timothy_alexis.vass
Version: MainKeywords: Manual
Hardware: All   
OS: All   
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
Bug Depends on:    
Bug Blocks: 28001    
Attachments: Bug 27050 - Allow multiple category_codes in delete_patrons.pl
Bug 27050 - Allow multiple category_codes in delete_patrons.pl
Bug 27050 - Allow multiple category_codes in delete_patrons.pl
Bug 27050: Allow multiple category_codes in delete_patrons.pl

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