mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various cleanup in import.
This commit is contained in:
@@ -98,7 +98,7 @@ class CsvProcessor implements FileProcessorInterface
|
||||
if ($this->rowAlreadyImported($row)) {
|
||||
$message = sprintf('Row #%d has already been imported.', $index);
|
||||
$this->repository->addStepsDone($this->job, 5);
|
||||
$this->addError($index, $message);
|
||||
$this->repository->addError($this->job, $index, $message);
|
||||
Log::info($message);
|
||||
|
||||
return null;
|
||||
@@ -154,23 +154,6 @@ class CsvProcessor implements FileProcessorInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shorthand method.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param int $index
|
||||
* @param string $message
|
||||
*/
|
||||
private function addError(int $index, string $message): void
|
||||
{
|
||||
$extended = $this->getExtendedStatus();
|
||||
$extended['errors'][$index][] = $message;
|
||||
$this->setExtendedStatus($extended);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add meta data to the individual value and verify that it can be handled in a later stage.
|
||||
*
|
||||
@@ -375,7 +358,7 @@ class CsvProcessor implements FileProcessorInterface
|
||||
*/
|
||||
private function specifics(array $row): array
|
||||
{
|
||||
$config = $this->job->configuration;
|
||||
$config = $this->getConfig();
|
||||
$names = array_keys($config['specifics'] ?? []);
|
||||
foreach ($names as $name) {
|
||||
if (!in_array($name, $this->validSpecifics)) {
|
||||
|
Reference in New Issue
Block a user