Skip to content
Snippets Groups Projects
Commit d364ce1d authored by Alex Barth's avatar Alex Barth
Browse files

#858684: Fix notices when file not found.

parent ed66ec31
No related branches found
No related tags found
No related merge requests found
// $Id$ // $Id$
Feeds 6.x 1.0 XXXXXXXXXXXXXXXXXX
--------------------------------
- #858684 alex_b: Fix notices when file not found.
Feeds 6.x 1.0 Beta 4, 2010-07-25 Feeds 6.x 1.0 Beta 4, 2010-07-25
-------------------------------- --------------------------------
......
...@@ -22,6 +22,9 @@ class FeedsCSVParser extends FeedsParser { ...@@ -22,6 +22,9 @@ class FeedsCSVParser extends FeedsParser {
// Get first line and use it for column names, convert them to lower case. // Get first line and use it for column names, convert them to lower case.
$parser->setLineLimit(1); $parser->setLineLimit(1);
$rows = $parser->parse($iterator); $rows = $parser->parse($iterator);
if (!count($rows)) {
return;
}
$header = array_shift($rows); $header = array_shift($rows);
foreach ($header as $i => $title) { foreach ($header as $i => $title) {
$header[$i] = trim(drupal_strtolower($title)); $header[$i] = trim(drupal_strtolower($title));
......
...@@ -32,6 +32,9 @@ class FeedsFileBatch extends FeedsImportBatch { ...@@ -32,6 +32,9 @@ class FeedsFileBatch extends FeedsImportBatch {
* Implementation of FeedsImportBatch::getFilePath(). * Implementation of FeedsImportBatch::getFilePath().
*/ */
public function getFilePath() { public function getFilePath() {
if (!file_exists($this->file_path)) {
throw new Exception(t('File @filepath is not accessible.', array('@filepath' => $this->file_path)));
}
return $this->file_path; return $this->file_path;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment