Closed (fixed)
Project:
Feeds
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Aug 2021 at 19:54 UTC
Updated:
30 Mar 2026 at 08:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
damienmckennaI noticed that the CSV contains a lot of blank records with no data, just rows of commas like this:
Comment #3
megachrizI think it kinda makes sense that when feeding empty data, empty records get created. Apparently, an empty record still passes validation: Feeds does execute
$entity->validate();before saving the entity.If I'm correct, the CSV parser in Feeds does skip completely empty lines in the file (lines that also don't have commas on them). Maybe the parser should also skip lines that only consists of the configured separator (commas in this case)?
Patches/issue forks are welcome.
Comment #4
redwan jamous commentedI will try creating a patch that treats lines with delimiter characters only as empty lines...
Comment #6
redwan jamous commentedCreate a MR that attempts to solve the problem by adding the delimiter character to the list of trimmed characters in the
next()method.I think we can also make this configurable and disabled by default to maintain backwards compatibility. Would appreciate some thoughts on this.
Attaching a static patch file to use with composer...
Comment #7
redwan jamous commentedComment #8
megachrizThis looks good to me. Thanks for fixing, @redwan jamous!
I've scheduled the merge.