Bug 26343

Summary: Blank columns in patron import CSV clears existing data when overwriting
Product: Koha Reporter: Donna <bwsdonna>
Component: ToolsAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Donna 2020-09-01 15:19:21 UTC
When importing/overlaying patrons, if you have any blank columns in the csv, any existing data in a patron record is cleared.  

There should be an option as to whether or not you intend to clear the data using blank columns or not.

To recreate:
1. Create patron with several items of data, such as address, city, phone.
2. Create a csv with username, address, and a blank column for phone
3. Import patron file, using the overwrite function
4. See that the phone info is now blank in the patron record.
Comment 1 Katrin Fischer 2020-10-19 16:42:27 UTC
I think this would be more suitable as an enhancement. 

The current behaviour that an empty cells means "reset" I think is ok and needed that way. But maybe we could add a checkbox to the list of default options saying to keep the existing value when empty in import?
Comment 2 Katrin Fischer 2022-10-17 21:18:27 UTC
Re-reading this again, I believe the bug description doesn't quite fit. I think the described behaviour is correct, because we need a way to reset/empty out fields. If the other behavior is still desirable, we should change it to read more as an alternative. But I can't come up with something right now :(
Comment 3 Katrin Fischer 2023-09-22 20:57:11 UTC
We do now have the option to select fields in the patron record that will be protected from being overwritten:

"Selected fields will be preserved from original patron record when overwriting existing patron."