Bug 348635 - CSV Importer can create Payee consisting of a single or multiple space leading to erronous matching
Summary: CSV Importer can create Payee consisting of a single or multiple space leadin...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: 4.7.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-03 13:09 UTC by rob.vdm.82
Modified: 2017-07-01 11:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.0
Sentry Crash Report:


Attachments
Sample import CSV (786 bytes, text/plain)
2015-06-03 13:10 UTC, rob.vdm.82
Details
Patch to fix problem. (2.10 KB, patch)
2015-06-04 13:43 UTC, allan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rob.vdm.82 2015-06-03 13:09:22 UTC
My bank issued CSV files have a  few Payee entries that contained a single space. This created a Payee entry in kmymoney called " " and started matching all subsequent Payto entries with a space somewhere in the name. 

Once I corrected my CSV and deleted the " " payee, import went as expected.

It would suggest to change Kmymoney and add some protection for this type of matching, like ignoring 1 character matches, or changing the csv importer code reformat " " to a truly empty field, or throw an error.

Reproducible: Always

Steps to Reproduce:
1. Import example CSV
2. Watch as it matches all payees to a single space

Actual Results:  
All blank payees

Expected Results:  
Not match nor create a single space payee
Comment 1 rob.vdm.82 2015-06-03 13:10:19 UTC
Created attachment 92973 [details]
Sample import CSV
Comment 2 allan 2015-06-03 13:32:14 UTC
This is confirmed.  I've produced a patch on the lines of your second suggestion.  I need to do some more testing, however.
Comment 3 allan 2015-06-04 13:43:12 UTC
Created attachment 92993 [details]
Patch to fix problem.

I'll leave the patch here for a few days, before committing.
Comment 4 allan 2015-06-11 21:35:47 UTC
Git commit e5cc53e369b6ec9bc0e7ae2a7a5662b417d190ed by Allan Anderson.
Committed on 11/06/2015 at 21:34.
Pushed by allananderson into branch 'master'.
Fix CSV Importer allowing creation of Payee consisting of a single or multiple spaces leading to erroneous
matching.

M  +7    -2    kmymoney/plugins/csvimport/csvdialog.cpp

http://commits.kde.org/kmymoney/e5cc53e369b6ec9bc0e7ae2a7a5662b417d190ed