diff --git a/src/Processing/ImportProcessingService.php b/src/Processing/ImportProcessingService.php index c003d0e9..1e220f87 100644 --- a/src/Processing/ImportProcessingService.php +++ b/src/Processing/ImportProcessingService.php @@ -192,6 +192,12 @@ protected function processElement(string $configName, array $importDataRow, Reso $element = $resolver->loadOrCreateAndPrepareElement($importDataRow, $createNew); if ($element instanceof ElementInterface) { + $this->applicationLogger->info("⭢ Processing DataRow {$importDataRowString}", [ + 'component' => PimcoreDataImporterBundle::LOGGER_COMPONENT_PREFIX . $configName, + null, + 'relatedObject' => $element + ]); + foreach ($mapping as $mappingConfiguration) { // extract raw data @@ -217,11 +223,6 @@ protected function processElement(string $configName, array $importDataRow, Reso $dataTarget = $mappingConfiguration->getDataTarget(); $dataTarget->assignData($element, $data); } - $this->applicationLogger->info("⭢ Processing DataRow {$importDataRowString}", [ - 'component' => PimcoreDataImporterBundle::LOGGER_COMPONENT_PREFIX . $configName, - null, - 'relatedObject' => $element - ]); $event = new PreSaveEvent($configName, $importDataRow, $element); $this->eventDispatcher->dispatch($event); @@ -247,7 +248,7 @@ protected function processElement(string $configName, array $importDataRow, Reso 'fileObject' => new FileObject(json_encode($importDataRow)) ]); } - } catch (\Exception $e) { + } catch (\Exception | \TypeError $e) { $message = "Error processing element: {$importDataRowString}"; $this->logger->error($message . $e);