Bug 36544 - Add option to choose a delimiter for patron import
Summary: Add option to choose a delimiter for patron import
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-08 12:39 UTC by Philip Orr
Modified: 2024-04-08 12:39 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.