Skip to content

Commit 84f5054

Browse files
committed
ACP2E-1813: Scheduled import logs successful run despite the error
- implemented static feedback adjustments
1 parent 31839d4 commit 84f5054

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

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

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -521,14 +521,8 @@ public function importSource()
521521
*/
522522
private function importSourceCallback()
523523
{
524-
$ids = $this->_getEntityAdapter()->getIds();
525-
if (empty($ids)) {
526-
$idsFromPostData = $this->getData(self::FIELD_IMPORT_IDS);
527-
if (null !== $idsFromPostData && '' !== $idsFromPostData) {
528-
$ids = explode(",", $idsFromPostData);
529-
$this->_getEntityAdapter()->setIds($ids);
530-
}
531-
}
524+
$ids = $this->getImportIds();
525+
$this->_getEntityAdapter()->setIds($ids);
532526
$this->setData('entity', $this->getDataSourceModel()->getEntityTypeCode($ids));
533527
$this->setData('behavior', $this->getDataSourceModel()->getBehavior($ids));
534528

@@ -583,6 +577,25 @@ private function importSourceCallback()
583577
return $result;
584578
}
585579

580+
/**
581+
* Get entity import ids
582+
*
583+
* @return array
584+
* @throws LocalizedException
585+
*/
586+
private function getImportIds(): array
587+
{
588+
$ids = $this->_getEntityAdapter()->getIds();
589+
if (empty($ids)) {
590+
$idsFromPostData = $this->getData(self::FIELD_IMPORT_IDS);
591+
if (null !== $idsFromPostData && '' !== $idsFromPostData) {
592+
$ids = explode(",", $idsFromPostData);
593+
}
594+
}
595+
596+
return $ids;
597+
}
598+
586599
/**
587600
* Process import.
588601
*

0 commit comments

Comments
 (0)