I had an issue with a whitespace terminating a column name in CSV parser
While parseHeader method is trimming the column name,
getSourceElement method is not.
In this case no mapping is done on the column value.
I would propose to trim both as described in the patch

CommentFileSizeAuthor
FeedsCSVParser.inc_.patch682 bytesmarco.giaco

Comments

paolomainardi’s picture

Subscribe

johnv’s picture

Version: 6.x-1.0-beta10 » 7.x-2.x-dev
Status: Patch (to be ported) » Needs review

This is still true.

lyricnz’s picture

Status: Needs review » Reviewed & tested by the community

I don't see any harm in this, even if it is only needed for "malformed" data.

twistor’s picture

Status: Reviewed & tested by the community » Needs work

AHHHHHH

The fact that the CSV parser lowercases keys has been the bane of my existence. Adding yet another transformation will make me bonkers. Either we do this to everything, very likely not possible, or none. Or, someone comes up with a fancier way to retrieve the key from an item somehow using the parser.

Very tempted to mark this as won't fix.

bluegeek9’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Drupal 7 reached end of life and the D7 version of Feeds is no longer being developed. To keep the issue queue focused on supported versions, we’re closing older D7 issues.

If you still have questions about using Feeds on Drupal 7, feel free to ask. While we won’t fix D7 bugs anymore, we’re happy to offer guidance to help you move forward. You can do so by opening (or reopening) a D7 issue, or by reaching out in the #feeds channel on Drupal Slack.

If this issue is still relevant for Drupal 10+, please open a follow-up issue or merge request with proposed changes. Contributions are always welcome!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.