Merge pull request #1321 from Flynsarmy/filterEmptyCsvImportRowsClosure

Filter out empty CSV rows before import
This commit is contained in:
Samuel Georges 2015-08-03 20:11:19 +10:00
commit d7eb4deac5
1 changed files with 5 additions and 0 deletions

View File

@ -93,6 +93,11 @@ abstract class ImportModel extends Model
$reader = CsvReader::createFromPath($filePath, 'r');
// Filter out empty rows
$reader->addFilter(function(array $row) {
return count($row) > 1 || reset($row) !== null;
});
if ($firstRowTitles) {
$reader->setOffset(1);
}