Fine-tuning the import routine.

This commit is contained in:
James Cole
2016-08-13 23:28:01 +02:00
parent bbed5d0701
commit c58eea6654
9 changed files with 117 additions and 37 deletions

View File

@@ -220,8 +220,13 @@ class ImportStorage
Log::warning(sprintf('Cannot import row %d, because the entry is not valid.', $index));
$result = new ImportResult();
$result->failed();
$errors = join(', ', $entry->errors->all());
$result->appendError(sprintf('Row #%d: ' . $errors, $index));
$errors = join(', ', $entry->errors->all());
$errorText = sprintf('Row #%d: ' . $errors, $index);
$result->appendError($errorText);
$extendedStatus = $this->job->extended_status;
$extendedStatus['errors'][] = $errorText;
$this->job->extended_status = $extendedStatus;
$this->job->save();
return $result;
}