Skip to content

Commit 5fce629

Browse files
committed
ACP2E-1813: Scheduled import logs successful run despite the error
- fixed static
1 parent 5d09281 commit 5fce629

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -480,14 +480,8 @@ public function getWorkingDir()
480480
*/
481481
public function importSource()
482482
{
483-
$ids = $this->_getEntityAdapter()->getIds();
484-
if (empty($ids)) {
485-
$idsFromPostData = $this->getData(self::FIELD_IMPORT_IDS);
486-
if (null !== $idsFromPostData && '' !== $idsFromPostData) {
487-
$ids = explode(",", $idsFromPostData);
488-
$this->_getEntityAdapter()->setIds($ids);
489-
}
490-
}
483+
$ids = $this->getImportIds();
484+
$this->_getEntityAdapter()->setIds($ids);
491485
$this->setData('entity', $this->getDataSourceModel()->getEntityTypeCode($ids));
492486
$this->setData('behavior', $this->getDataSourceModel()->getBehavior($ids));
493487

@@ -540,6 +534,20 @@ public function importSource()
540534
return $result;
541535
}
542536

537+
private function getImportIds(): array
538+
{
539+
$ids = $this->_getEntityAdapter()->getIds();
540+
if (empty($ids)) {
541+
$idsFromPostData = $this->getData(self::FIELD_IMPORT_IDS);
542+
if (null !== $idsFromPostData && '' !== $idsFromPostData) {
543+
$ids = explode(",", $idsFromPostData);
544+
$this->_getEntityAdapter()->setIds($ids);
545+
}
546+
}
547+
548+
return $ids;
549+
}
550+
543551
/**
544552
* Process import.
545553
*

0 commit comments

Comments
 (0)