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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zippydoug’s picture

FileSize
1.65 KB
mgifford’s picture

Thanks for this. Curious though why you didn't submit a patch to the module? That is always way easier to read.

zippydoug’s picture

I 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.

mgifford’s picture

Cool!

zippydoug’s picture

I moved the functionality from the alter_hook method to integrating it into the feeds module.

Status: Needs review » Needs work

The last submitted patch, 5: csv-parser-error-checking-2285403.patch, failed testing.

jthorson’s picture

Version: 7.x-2.0-alpha8 » 7.x-2.x-dev
jthorson’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: csv-parser-error-checking-2285403.patch, failed testing.

jthorson’s picture

The 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.

luco’s picture

hey 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