Filter out empty CSV rows before import
This commit is contained in:
parent
dbac4809f6
commit
f573438c90
|
|
@ -93,6 +93,11 @@ abstract class ImportModel extends Model
|
|||
|
||||
$reader = CsvReader::createFromPath($filePath);
|
||||
|
||||
// Filter out empty rows
|
||||
$reader->addFilter(function(array $row) {
|
||||
return count($row) > 1 || reset($row) !== null;
|
||||
});
|
||||
|
||||
if ($firstRowTitles) {
|
||||
$reader->setOffset(1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue