Bug 36544

Summary: Add option to choose a delimiter for patron import
Product: Koha Reporter: Philip Orr <philip.orr>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23668
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Philip Orr 2024-04-08 12:39:14 UTC
By default the patron import tool (accessed by going to Tools ->
Import Patrons) uses commas to separate fields.
This is fine in most cases, but there is one problem:
If you have patron attributes enabled and are importing patrons with
values in the patron attribute fields, it could happen that the value
of a patron attribute field to be imported contains a comma.
For instance, your patron attribute field could be "Names of family members"
and the value could be "John Doe, Jane Doe".
In that case the attribute will not be imported correctly due to the comma
and the patron import could also fail.
In this case it would be good to have the choice to use a different delimiter.

To replicate:
- First to set up a new patron attribute type called "FAMILY":
- navigate to Administration -> Patron Attribute Types
- Click on "New patron attribute type"
- Patron attribute type code: "FAMILY", description "Names of family members"
- save
- Then create a .csv file with the following content:
cardnumber,surname,branchcode,categorycode,patron_attributes
123123123,Testuser,MPL,S,FAMILY:John Doe,Jane Doe

- Go to Tools -> Import patrons
- Import your file
- Under Feedback, it will contain: "attribute string : FAMILY:John Doe "
- Everything after the comma is missing

The help text next to patron import suggests using double quotes wrapped around
patron attribute field values that contain commas, but that didn't work for me
either. If you want to replicate that, do everything as above but in your .csv
file use the following content:
cardnumber,surname,branchcode,categorycode,patron_attributes
123123123,Testuser,MPL,S,"FAMILY:John Doe,Jane Doe"

Should then fail to be imported due to an unexpected format.