After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 721929 - Importing a customer list causes a crash.
Importing a customer list causes a crash.
Status: RESOLVED INCOMPLETE
Product: GnuCash
Classification: Other
Component: Business
2.6.0
Other All
: Normal normal
: ---
Assigned To: Mike Evans
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-10 12:03 UTC by Mike Evans
Modified: 2018-06-29 23:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test file (62 bytes, application/octet-stream)
2014-01-12 16:47 UTC, junker
Details

Description Mike Evans 2014-01-10 12:03:24 UTC
Importing a customer list causes a crash.

Sample import that causes crash:
,Foundation Academy,Foundation Academy,,,,,5551233222,,,,,,,,,
Comment 1 Mike Evans 2014-01-10 12:15:24 UTC
Fixes commited as r23677
Comment 2 Derek Atkins 2014-01-10 16:45:36 UTC
So what exactly was the problem?
Comment 3 Mike Evans 2014-01-10 17:01:20 UTC
The original code had a limited field count; company, name, addr1, addr2, addr3, addr4.  I modifed it to include all the fields including the ship to parameters.  I appear to forgotten to this this in one function gnc_customer_import_fix_customers(...),  then didn't test it enough, then got sidetracked... And here we are.

I'll leave this bug open until it's had more user testing.
Comment 4 junker 2014-01-10 18:36:58 UTC
How do I get a 2.6 version to test it?
Comment 5 Mike Evans 2014-01-10 22:07:21 UTC
Nightly builds should be available at:
http://code.gnucash.org/builds/win32/trunk/
Comment 6 junker 2014-01-11 00:03:50 UTC
Okay. Give me hollar when you want to start testing it.
BTW, Excel doesn't always include all the commas on a row particularly if there is no data in that column.
Let me give you an example:
If I have a heading row that has id,company,name,addr1,addr2,addr3,addr4,phone etc all the way out to shipping. Then I enter data in some of the cells, but not others, then there will be data,,,,,,,data on that row in the cvs file.

But let's say I don't have any heading row, and all I do is put in data in different columns.
Then, unless I put in an id number, there will not be a , ahead of the company and commas after the last entry on that row will have those commas truncated.

If you don't understand, I will post two files that will demonstrate the issue.
Comment 7 Derek Atkins 2014-01-11 00:28:42 UTC
It sounds like you already have your workaround:  put in a header row.
I think that's a perfectly reasonable requirement for this feature.
Comment 8 junker 2014-01-11 01:48:49 UTC
Except that right now, it doesn't work either. Take my word for it, I massaged the data so many ways it made me silly.

I went on the assumption that this feature had been well tested else it wouldn't have been put in the stable version, so it MUST be my fault.
Comment 9 Mike Evans 2014-01-11 11:26:22 UTC
Testing, that's what the unstable releases are for.  Obviously nobody bothered to test it.

Anyway, I've updated the code and there's a new nightly build, so feel free to test.

Good point about Excel and missing commas.  The importer definately needs to be more flexible and that enhancement probably needs a bug of it's own.
Comment 10 junker 2014-01-12 16:47:30 UTC
Created attachment 266066 [details]
test file
Comment 11 junker 2014-01-12 16:48:29 UTC
Try this file. Using the 1/11 nightly it's not working for me.
Comment 12 Mike Evans 2014-01-13 10:30:38 UTC
junker

Works for in Linux.  There is no CR LF at the end of the line though.  Try adding a new blank line after it using the Enter key.  I can't test it on Windows so I don't know how endless lines are handled.
Comment 13 Mike Evans 2014-01-23 11:09:53 UTC
junker

Still broken after adding a final newline?
Comment 14 junker 2014-01-23 16:59:22 UTC
(In reply to comment #13)
> junker
> 
> Still broken after adding a final newline?

I'm sorry. My email box runeth over and I missed your post. I'll test it tonight or today.
Comment 15 junker 2014-01-24 13:44:37 UTC
I'm having mixed success here. The one line test data works fine as does another short test file I made up with 25 rows in it. Larger files fail. It may have to do with spotty comma inclusion for the blank fields, but I don't know. I'm going to have to play some more.

I was importing transactions using a CSV the other day and there is some pretty good code there about getting the data into the correct columns. That code  creates the structure needed for a successful importation. I don't know if you can reuse it, but I think if you can, it would work better than me counting commas.
Comment 16 Geert Janssens 2014-09-23 20:21:03 UTC
Removing NeedInfo status as junker did provide the requested info.
Comment 17 Mike Evans 2014-09-24 07:36:22 UTC
I was waiting for the results of "play some more".

So now the issue is either "spotty comma inclusion" in an Excel export or there are too many lines in the file.
Comment 18 Geert Janssens 2014-09-24 08:02:36 UTC
Ah, I missed that part. If you still want to wait that additional info, you can reset the status to "NEEDINFO".
Comment 19 Mike Evans 2014-12-27 12:46:29 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!
Comment 20 John Ralls 2018-06-29 23:24:27 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=721929. Please update any external references or bookmarks.