Skip to content

Commit 0b9204b

Browse files
committed
MAGETWO-58227: Broken import of configurable products
1 parent 90b30a8 commit 0b9204b

File tree

1 file changed

+2
-16
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import

1 file changed

+2
-16
lines changed

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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ public function __construct(
760760
$this->_linkFactory = $linkFactory;
761761
$this->_proxyProdFactory = $proxyProdFactory;
762762
$this->_uploaderFactory = $uploaderFactory;
763+
$this->filesystem = $filesystem;
763764
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::ROOT);
764765
$this->_stockResItemFac = $stockResItemFac;
765766
$this->_localeDate = $localeDate;
@@ -1999,27 +2000,12 @@ protected function uploadMediaFiles($fileName, $renameFileOff = false)
19992000
private function getSystemFile($fileName)
20002001
{
20012002
$filePath = 'catalog' . DIRECTORY_SEPARATOR . 'product' . DIRECTORY_SEPARATOR . $fileName;
2002-
/** @var Filesystem $filesystem */
2003-
$filesystem = $this->getFilesystem();
20042003
/** @var \Magento\Framework\Filesystem\Directory\ReadInterface $read */
2005-
$read = $filesystem->getDirectoryRead(DirectoryList::MEDIA);
2004+
$read = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
20062005

20072006
return $read->isExist($filePath) && $read->isReadable($filePath) ? $fileName : '';
20082007
}
20092008

2010-
/**
2011-
* Getter for singleton-like Filesystem object.
2012-
*
2013-
* @return Filesystem
2014-
*/
2015-
private function getFilesystem()
2016-
{
2017-
if (!$this->filesystem) {
2018-
$this->filesystem = ObjectManager::getInstance()->get(Filesystem::class);
2019-
}
2020-
return $this->filesystem;
2021-
}
2022-
20232009
/**
20242010
* Save product media gallery.
20252011
*

0 commit comments

Comments
 (0)