Skip to content

Commit 4f6588c

Browse files
committed
Merge remote-tracking branch 'github-magento/MAGETWO-91640' into EPAM-PR-16
2 parents 91aa22b + d3a62b1 commit 4f6588c

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,8 +1635,11 @@ protected function _saveProducts()
16351635
continue;
16361636
}
16371637
if ($this->getErrorAggregator()->hasToBeTerminated()) {
1638-
$this->getErrorAggregator()->addRowToSkip($rowNum);
1639-
continue;
1638+
$validationStrategy = $this->_parameters[Import::FIELD_NAME_VALIDATION_STRATEGY];
1639+
if (ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_SKIP_ERRORS !== $validationStrategy) {
1640+
$this->getErrorAggregator()->addRowToSkip($rowNum);
1641+
continue;
1642+
}
16401643
}
16411644
$rowScope = $this->getRowScope($rowData);
16421645

app/code/Magento/ImportExport/Model/Import.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel
181181
* @param Source\Import\Behavior\Factory $behaviorFactory
182182
* @param \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry
183183
* @param History $importHistoryModel
184-
* @param \Magento\Framework\Stdlib\DateTime\DateTime
184+
* @param \Magento\Framework\Stdlib\DateTime\DateTime $localeDate
185185
* @param array $data
186186
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
187187
*/
@@ -443,6 +443,8 @@ public function importSource()
443443
}
444444

445445
/**
446+
* Processing of import.
447+
*
446448
* @return bool
447449
* @throws \Magento\Framework\Exception\LocalizedException
448450
*/
@@ -462,6 +464,8 @@ public function isImportAllowed()
462464
}
463465

464466
/**
467+
* Get error aggregator instance.
468+
*
465469
* @return ProcessingErrorAggregatorInterface
466470
* @throws \Magento\Framework\Exception\LocalizedException
467471
*/
@@ -585,6 +589,11 @@ public function validateSource(\Magento\ImportExport\Model\Import\AbstractSource
585589
$this->addLogComment($messages);
586590

587591
$result = !$errorAggregator->getErrorsCount();
592+
$validationStrategy = $this->getData(self::FIELD_NAME_VALIDATION_STRATEGY);
593+
if ($validationStrategy === ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_SKIP_ERRORS) {
594+
$result = true;
595+
}
596+
588597
if ($result) {
589598
$this->addLogComment(__('Import data validation is complete.'));
590599
}
@@ -710,9 +719,9 @@ public function isReportEntityType($entity = null)
710719
/**
711720
* Create history report
712721
*
722+
* @param string $sourceFileRelative
713723
* @param string $entity
714724
* @param string $extension
715-
* @param string $sourceFileRelative
716725
* @param array $result
717726
* @return $this
718727
* @throws \Magento\Framework\Exception\LocalizedException

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ public function testInvalidSkuLink()
958958
$errors = $this->_model->setParameters(
959959
[
960960
'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND,
961+
Import::FIELD_NAME_VALIDATION_STRATEGY => null,
961962
'entity' => 'catalog_product'
962963
]
963964
)->setSource(

0 commit comments

Comments
 (0)