- ๐ฎ๐ณIndia shubho8
--SOLVED--
You will get this error if the parser is not able to read the CSV file.
Please check the delimiter, it can be , ; | ets.Open the csv file in a text editor or VS code to find out which delimiter you have to use.
Hope it helps
- ๐ณ๐ฟNew Zealand thomasmurphy
I was getting this error on 8.x-3.0 on D11 with a csv which didn't have quoted values, eg
one, two, three
rather than"one","two","three"
I reformatted a local csv copy with all cells quoted and it's successfully imports. I think the error handing for this kind of situation could be improved, it's not obvious that the first format is unsupported.
- ๐ณ๐ฑNetherlands megachriz
@thomasmurphy
I have not tested it, but I think thatone, two, three
doesn't work because there are spaces used. So the column names effectively became "one", " two" and " three". " two" is not equal to "two", because the first one starts with a space and the second doesn't.In ๐ CSV headers with extra space don't get mapped to correct fields Needs work there is being worked on a feature to ignore leading or closing spaces in CSV column names.
There also exists an issue to implement a feature to detect mismatches in configured CSV column names vs actual CSV column names: โจ Allow parsers to validate source before import Active . - ๐ณ๐ฟNew Zealand thomasmurphy
@megachriz thanks, I was curious about this exact failure mode, so I double checked various csv formats. Unquoted UTF-8 actually imports fine, it was the fact that the original csv was UTF-16, and that when I had changed the format (in libre office) to be fully quoted, it defaulted to changing it from UTF-16 to UTF-8, which was what actually fixed the import error. Is this, perhaps a limitation of Drupal's database abstraction layer, rather than something the module should address?
In any case, I'm not requesting that every file format be supported because there are a lot of edge cases. It's just that the error is quite unrelated to what's actually gone wrong. Even adding a note in the error to check your source file format would be helpful, rather than just stating that the title shouldn't be blank might be an easy step to improve things. eg "title cannot be blank. Try checking your source file format".