Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error - Fails to parse csv when duplicate record in imported csv . #35

Open
jcop007 opened this issue Feb 9, 2017 · 7 comments
Open

Comments

@jcop007
Copy link

jcop007 commented Feb 9, 2017

Hi
We're importing a csv with cols 'FromBase','FromQuerystring','To'
If any of the rows are not unique across the two cols 'FromBase' & 'FromQuerystring' it will throw a fatal error.
Failed to parse C:\WINDOWS\TEMP\silverstripe-cache-php5.5.12C--wamp-www-enjoyillinoiscom\JONATHAN-4/BulkLoader589cbd0d829a31.37719436.csv
Fatal error: Call to a member function CreatedCount() on a non-object in C:\wamp\www\enjoyillinoiscom\framework\admin\code\ModelAdmin.php on line 445
Thanks

@dhensby
Copy link
Contributor

dhensby commented Feb 15, 2017

Is this something you'd be happy to investigate?

@michalkleiner
Copy link
Contributor

@jcop007 there is a unique database index on those two columns. It makes sense to limit it so there's only one pair of FromBase and FromQueryString. If there was more combinations, how would you decide which destination to choose to redirect to?

@jcop007
Copy link
Author

jcop007 commented May 3, 2017

@michalkleiner Yes, that's true. My main issue was that it took use many hours to figure out what was causing the error and then which row in the spreadsheet was responsible. If the error message could display that information it would be very helpful.

@dhensby
Copy link
Contributor

dhensby commented Nov 23, 2017

hmm, that is an unhelpful error if the real problem is a duplicate unique index - anyone prepared to patch it?

@stevie-mayhew
Copy link
Contributor

I've just tested this against the 4.x compatible line (master) and it is no longer an issue.

@jcop007 do you have a fix for the 3.x compatible (1) line?

@jcop007
Copy link
Author

jcop007 commented Apr 18, 2018

@stevie-mayhew No, we didn't write a fix. We just removed duplicates once we figured out that was the issue. I'll take another look and see if we can get a fix for it.

@priyashantha
Copy link

@stevie-mayhew @dhensby Here is a PR #59 for this issue. Could someone please review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants