GNOME Bugzilla – Bug 721929
Importing a customer list causes a crash.
Last modified: 2018-06-29 23:24:27 UTC
Importing a customer list causes a crash. Sample import that causes crash: ,Foundation Academy,Foundation Academy,,,,,5551233222,,,,,,,,,
Fixes commited as r23677
So what exactly was the problem?
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.
How do I get a 2.6 version to test it?
Nightly builds should be available at: http://code.gnucash.org/builds/win32/trunk/
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.
It sounds like you already have your workaround: put in a header row. I think that's a perfectly reasonable requirement for this feature.
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.
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.
Created attachment 266066 [details] test file
Try this file. Using the 1/11 nightly it's not working for me.
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.
junker Still broken after adding a final newline?
(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.
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.
Removing NeedInfo status as junker did provide the requested info.
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.
Ah, I missed that part. If you still want to wait that additional info, you can reset the status to "NEEDINFO".
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!
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.