mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-21 00:50:07 +00:00
Only fire post-processing specifix in the import routine. See issue #145
This commit is contained in:
@@ -246,6 +246,8 @@ class Importer
|
|||||||
|
|
||||||
Log::debug('Column #' . $index . ' (role: ' . $role . ') : converter ' . $class . ' stores its data into field ' . $field . ':');
|
Log::debug('Column #' . $index . ' (role: ' . $role . ') : converter ' . $class . ' stores its data into field ' . $field . ':');
|
||||||
|
|
||||||
|
// here would be the place where preprocessors would fire.
|
||||||
|
|
||||||
/** @var ConverterInterface $converter */
|
/** @var ConverterInterface $converter */
|
||||||
$converter = app('FireflyIII\Helpers\Csv\Converter\\' . $class);
|
$converter = app('FireflyIII\Helpers\Csv\Converter\\' . $class);
|
||||||
$converter->setData($data); // the complete array so far.
|
$converter->setData($data); // the complete array so far.
|
||||||
@@ -294,10 +296,12 @@ class Importer
|
|||||||
foreach ($this->getSpecifix() as $className) {
|
foreach ($this->getSpecifix() as $className) {
|
||||||
/** @var SpecifixInterface $specifix */
|
/** @var SpecifixInterface $specifix */
|
||||||
$specifix = app('FireflyIII\Helpers\Csv\Specifix\\' . $className);
|
$specifix = app('FireflyIII\Helpers\Csv\Specifix\\' . $className);
|
||||||
$specifix->setData($this->importData);
|
if ($specifix->getProcessorType() == SpecifixInterface::POST_PROCESSOR) {
|
||||||
$specifix->setRow($this->importRow);
|
$specifix->setData($this->importData);
|
||||||
Log::debug('Now post-process specifix named ' . $className . ':');
|
$specifix->setRow($this->importRow);
|
||||||
$this->importData = $specifix->fix();
|
Log::debug('Now post-process specifix named ' . $className . ':');
|
||||||
|
$this->importData = $specifix->fix();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user