If I have a processor that has a target field whose label is "eats, shoots, and leaves", then the UI for the importer makes it look like CSV file should have columns like:

foo, eats, shoots, and leaves, bar

making it looks like there are more columns involved, and with the wrong names.

Target fields that contain commas should be quoted.

Comments

megachriz’s picture

megachriz’s picture

Issue tags: +Novice

Sounds like it's easy to solve. Tagging as a novice issue.

pravin ajaaz’s picture

StatusFileSize
new421 bytes

Patch adds Quotes for target column name that contains comma.

pravin ajaaz’s picture

Status: Active » Needs review
megachriz’s picture

Status: Needs review » Needs work

When I have a mapping source called "eats, shoots, and leaves" (manually entered on the mapping form) I still see the following when I go to /import/%importer_id:

foo, eats, shoots, and leaves, bar

I think the change need to be made in /plugins/FeedsCSVParser.inc.

pravin ajaaz’s picture

StatusFileSize
new746 bytes

Sorry I miss understood the OP. Thanks for guiding me.

pravin ajaaz’s picture

Status: Needs work » Needs review
megachriz’s picture

Tested and works okay. Tiny coding standard issues, though:

Otherwise good.

pravin ajaaz’s picture

StatusFileSize
new747 bytes

@MegaChriz: Thanks for the review. I made the recommended changes

megachriz’s picture

Status: Needs review » Reviewed & tested by the community

Good. I see no more issues with this patch. RTBC.

twistor’s picture

Status: Reviewed & tested by the community » Needs work

This should check for $this->config['delimiter'];, rather than hard code the delimiter.

pravin ajaaz’s picture

I think I am not hard coding delimiter here. Just adding quotes to the column names which are comma separated.

megachriz’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new45.51 KB

@twistor I thought at first too that something with the delimiter needed to be done, but that isn't the case. It is only the text in the UI that tells which columns should be used in the CSV and the UI text always separates the column names with comma's, regardless of the delimiter. This issue is about fixing the UI text in case comma's are used in column names.
See also the attached image:

Back to RTBC.

  • twistor committed 4fb9d3b on 7.x-2.x authored by Pravin Ajaaz
    Issue #2397151 by Pravin Ajaaz: importer UI for CSVs should quote column...
twistor’s picture

Status: Reviewed & tested by the community » Fixed

Works for me, thanks!

There's still going to be some oddness, if the column contains a quote character, but that should be rare.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.