Bug 35061 - Add support to preserve patron category code when importing patrons with commandline script
Summary: Add support to preserve patron category code when importing patrons with comm...
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-16 00:55 UTC by Aleisha Amohia
Modified: 2024-09-13 08:59 UTC (History)
2 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 35061: Preserve categorycode when importing patrons (3.38 KB, patch)
2023-10-16 01:00 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 35061: Preserve categorycode when importing patrons (3.46 KB, patch)
2024-09-13 03:11 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2023-10-16 00:55:39 UTC

    
Comment 1 Aleisha Amohia 2023-10-16 01:00:47 UTC
Created attachment 157180 [details] [review]
Bug 35061: Preserve categorycode when importing patrons

This patch should preserve category codes when importing patrons using misc/import_patrons.pl

Use case:

/usr/share/koha/bin/import_patrons.pl --file patrons.csv  --matchpoint userid --default branchcode=C --overwrite --preserve-categorycode --verbose --confirm

To test, use a file with a column categorycode. Confirm that new patrons added from the spreadsheet by the file are added to the database with the correct category code. Confirm existing patrons that are overwritten receive the categorycode from the spreadsheet.

Sponsored-by: Auckland University of Technology
Comment 2 Katrin Fischer 2023-10-16 19:50:53 UTC
The GUI already allows to write-protect any field of the patron record. I think this would be much more consistent and useful, if we had a parameter instead that allowed to pass a list of borrowers fields.
Comment 3 Aleisha Amohia 2024-09-13 03:11:39 UTC
Created attachment 171437 [details] [review]
Bug 35061: Preserve categorycode when importing patrons

This patch should preserve category codes when importing patrons using misc/import_patrons.pl

Use case:

/usr/share/koha/bin/import_patrons.pl --file patrons.csv  --matchpoint userid --default branchcode=C --overwrite --preserve-categorycode --verbose --confirm

To test, use a file with a column categorycode. Confirm that new patrons added from the spreadsheet by the file are added to the database with the correct category code. Confirm existing patrons that are overwritten receive the categorycode from the spreadsheet.

Sponsored-by: Auckland University of Technology
Comment 4 Katrin Fischer 2024-09-13 08:59:11 UTC
(In reply to Katrin Fischer from comment #2)
> The GUI already allows to write-protect any field of the patron record. I
> think this would be much more consistent and useful, if we had a parameter
> instead that allowed to pass a list of borrowers fields.

I still think this to be true as we'd want to match the script as closely to what the GUI can as possible. Also we already have the "default" option that takes a list of fields. It would be more consistent.