Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data transform warning messages #349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Classes/Step/TransformDataStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Cobweb\ExternalImport\ImporterAwareInterface;
use Cobweb\ExternalImport\Utility\MappingUtility;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;

Expand Down Expand Up @@ -252,6 +253,11 @@ public function applyUserFunction(string $name, array $configuration, array $rec
} catch (InvalidRecordException $e) {
// This exception means that the record must be removed from the dataset entirely
unset($records[$index]);

$this->importer->addMessage(
$e->getMessage(),
AbstractMessage::WARNING
);
$this->importer->debug(
LocalizationUtility::translate(
'LLL:EXT:external_import/Resources/Private/Language/ExternalImport.xlf:invalidRecordRemoved',
Expand All @@ -270,6 +276,11 @@ public function applyUserFunction(string $name, array $configuration, array $rec
} catch (\Exception $e) {
// If the value could not be transformed, remove it from the imported dataset
unset($records[$index][$name]);

$this->importer->addMessage(
$e->getMessage(),
AbstractMessage::WARNING
);
$this->importer->debug(
LocalizationUtility::translate(
'LLL:EXT:external_import/Resources/Private/Language/ExternalImport.xlf:transformationFailedWithMessage',
Expand Down