Skip to content

Commit

Permalink
fix(cli/import): import miss formated excel (#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
theus77 authored Dec 4, 2024
1 parent da7339c commit ef50753
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$expressionLanguage = new ExpressionLanguage();
$rows = $this->fileReader->getData($file, false, $this->encoding);
$header = \array_map('trim', $rows[0] ?? []);
$header = \array_filter(\array_map('trim', $rows[0] ?? []));

$ouuids = [];
if ($this->deleteMissingDocuments) {
Expand All @@ -107,6 +107,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$row = [];
$empty = true;
foreach ($rowValues as $cellKey => $cell) {
if (null === ($header[$cellKey] ?? null) && null === $cell) {
continue;
}
$row[$header[$cellKey] ?? $cellKey] = $cell;
$empty = $empty && (null === $cell);
}
Expand Down

0 comments on commit ef50753

Please sign in to comment.