Skip to content

Commit 03a5260

Browse files
committed
Merge remote-tracking branch 'origin/AC-11588v2' into spartans_pr_15042024
2 parents 26e7276 + 4d1f6b9 commit 03a5260

File tree

1 file changed

+7
-3
lines changed
  • app/code/Magento/ImportExport/Controller/Adminhtml/Import

1 file changed

+7
-3
lines changed

app/code/Magento/ImportExport/Controller/Adminhtml/Import/Validate.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ private function processValidationResult($validationResult, $resultBlock)
8383

8484
if ($import->getProcessedRowsCount()) {
8585
if ($validationResult) {
86-
$this->addMessageForValidResult($resultBlock);
86+
$totalError = $errorAggregator->getErrorsCount();
87+
$totalRows = $import->getProcessedRowsCount();
88+
$this->addMessageForValidResult($resultBlock, $totalError, $totalRows);
8789
} else {
8890
$resultBlock->addError(
8991
__('Data validation failed. Please fix the following errors and upload the file again.')
@@ -154,12 +156,14 @@ private function addMessageToSkipErrors(Result $resultBlock)
154156
* 2. Add message for case when imported data was checked and result is valid, but import is not allowed.
155157
*
156158
* @param Result $resultBlock
159+
* @param Import $totalError
160+
* @param Import $totalRows
157161
* @return void
158162
* @throws \Magento\Framework\Exception\LocalizedException
159163
*/
160-
private function addMessageForValidResult(Result $resultBlock)
164+
private function addMessageForValidResult(Result $resultBlock, $totalError, $totalRows)
161165
{
162-
if ($this->getImport()->isImportAllowed()) {
166+
if ($this->getImport()->isImportAllowed() && $totalRows > $totalError) {
163167
$resultBlock->addSuccess(__('File is valid! To start import process press "Import" button'), true);
164168
} else {
165169
$resultBlock->addError(__('The file is valid, but we can\'t import it for some reason.'));

0 commit comments

Comments
 (0)