In parse method of CSVParser there is
if (!$header) {
return;
}
So it can return null.
In import method of FeedsSource.inc there is
$parser_result = $this->importer->parser->parse($this, $this->fetcher_result);
module_invoke_all('feeds_after_parse', $this, $parser_result);
if $parser_result is null and you have your custom after_parse hook(what actually happened to me) null will be passed as the second argument and you will get fatal error like:
Recoverable fatal error: Argument 2 passed to custom_module_feeds_after_parse() must be an instance of FeedsParserResult
Comments
Comment #1
adamps commentedSpecifically this can occur if the CSV file exists but does not have read permission. Potentially there are other scenarios.
It would help a lot to have better error reporting.
Comment #2
adamps commentedHere is a patch that checks the file can be read rather than just exists.
Comment #5
twistor commentedIt looks like you're using an old version of Feeds. FeedsCSVParser::parse() can never return null.
The patch in #2 is a good idea anyway.
Comment #7
adamps commentedSorry I missed the notification email so have only just seen your response - thanks!