Problem/Motivation
Feeds CSV imports often fail due to bad import files. The rollback interface allows the user to undo, fix the file and redo the import. When a header row is used it's also possible to check the mappings against the CSV and warn the user when the CSV columns are missing.
Proposed resolution
When headers are used, check the unique mappings in the database configuration against the headers found in the CSV. Stop the import if mappings are missing and complete the import, but notify the user if there are extra, unused columns in the CSV.
I will attach the small module that implements this. I think this is a good feature to add to feeds CSV parser directly, if you agree, I'll rewrite the check as a patch to feeds.
Comment | File | Size | Author |
---|---|---|---|
#5 | csv-parser-error-checking-2285403.patch | 5.4 KB | zippydoug |
#1 | the_standard_import.tgz | 1.65 KB | zippydoug |
Comments
Comment #1
zippydoug CreditAttribution: zippydoug commentedComment #2
mgiffordThanks for this. Curious though why you didn't submit a patch to the module? That is always way easier to read.
Comment #3
zippydoug CreditAttribution: zippydoug commentedI am brand new to Drupal and didn't know how to make a patch file.
In fact, this is my first ever Drupal work.
Today I am attempting to create said patch file.
Comment #4
mgiffordCool!
Comment #5
zippydoug CreditAttribution: zippydoug commentedI moved the functionality from the alter_hook method to integrating it into the feeds module.
Comment #7
jthorson CreditAttribution: jthorson commentedComment #8
jthorson CreditAttribution: jthorson commented5: csv-parser-error-checking-2285403.patch queued for re-testing.
Comment #10
jthorson CreditAttribution: jthorson commentedThe patch definitely does something nasty to the Scheduler tests ... looks like some sort of loop condition, based on there being 75,000 extra assertions on the test, relative to the project test without this patch.
Comment #11
luco CreditAttribution: luco commentedhey there,
I tested the patch and it works flawlessly. thank you very much!
is there something I can contribute to help get this patch in the code? if so please let me know.
cheers,
Luciano