Bug 35264 - Update patron import to use protected column
Summary: Update patron import to use protected column
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: David Cook
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 26170
Blocks:
  Show dependency treegraph
 
Reported: 2023-11-06 05:24 UTC by David Cook
Modified: 2024-07-04 20:37 UTC (History)
5 users (show)

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


Attachments
Bug 35264: Add "protected" column to patron import (2.30 KB, patch)
2023-11-06 05:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35264: Add "protected" column to patron import (2.37 KB, patch)
2023-11-06 09:41 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2023-11-06 05:24:03 UTC
Bug 26170 adds a new "protected" patrons column. 

This broke the unit test t/db_dependent/Koha/Patrons/Import.t which reminds us that we need to also update /cgi-bin/koha/tools/import_borrowers.pl
Comment 1 David Cook 2023-11-06 05:36:01 UTC
Created attachment 158486 [details] [review]
Bug 35264: Add "protected" column to patron import

This change adds the "protected" column to patron import.

Test plan:
0. Apply the patch and run "restart_all"
1. prove -v t/db_dependent/Koha/Patrons/Import.t
2. Go to http://localhost:8081/cgi-bin/koha/tools/import_borrowers.pl
3. Note "protected" is listed in the "fields you want to supply"
on the right side of the screen
4. Note "protected" appears in file downloaded by clicking
"Download a Starter CSV file with all the columns"
5. Note that "Protected" appears after clicking "Enter default values"
and after clicking "Preserve existing values"

6. For bonus marks, use the "Starter CSV file" to import a test patron
(remember surname, branchcode, and categorycode are the required fields)
Comment 2 Martin Renvoize (ashimema) 2023-11-06 08:29:29 UTC
Thanks David.. I was just looking at this myself.

I wasn't yet sure whether the fix was here as you've suggested or whether we should be deleting the key when not present.. or a mix of both.

Digging a bit deeper now.
Comment 3 Martin Renvoize (ashimema) 2023-11-06 09:41:18 UTC
Created attachment 158494 [details] [review]
Bug 35264: Add "protected" column to patron import

This change adds the "protected" column to patron import.

Test plan:
0. Apply the patch and run "restart_all"
1. prove -v t/db_dependent/Koha/Patrons/Import.t
2. Go to http://localhost:8081/cgi-bin/koha/tools/import_borrowers.pl
3. Note "protected" is listed in the "fields you want to supply"
on the right side of the screen
4. Note "protected" appears in file downloaded by clicking
"Download a Starter CSV file with all the columns"
5. Note that "Protected" appears after clicking "Enter default values"
and after clicking "Preserve existing values"

6. For bonus marks, use the "Starter CSV file" to import a test patron
(remember surname, branchcode, and categorycode are the required fields)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2023-11-06 09:42:26 UTC
Going straight for a QA here as it get tests passing again.

All works as designed and resolves the issue. Thanks for jumping on it David.

Passing QA
Comment 5 Magnus Enger 2023-11-06 09:58:10 UTC
Thanks for jumping on this before I could get round to it. You guys are awesome!
Comment 6 Tomás Cohen Arazi (tcohen) 2023-11-06 11:43:36 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-11-10 07:32:12 UTC
Depends on Bug 26170 not in 23.05.x