Skip to content

Commit b179dfd

Browse files
andimovvzabaznov
authored andcommitted
MAGETWO-55447: Portdown MAGETWO-54718 down to M2.1.x branch
- MAGETWO-54718: [GitHub] Exception thrown where no Product Image file found #5184 #5497 #5871 - (cherry picked from commit 1ef843d)
1 parent 10b20c0 commit b179dfd

File tree

1 file changed

+2
-6
lines changed
  • app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery

1 file changed

+2
-6
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,8 @@ public function getImagesJson()
147147
$fileHandler = $mediaDir->stat($this->_mediaConfig->getMediaPath($image['file']));
148148
$image['size'] = $fileHandler['size'];
149149
} catch (FileSystemException $e) {
150-
$staticDir = $this->_filesystem->getDirectoryRead(DirectoryList::STATIC_VIEW);
151-
$image['url'] = $this->getImageHelper()->getDefaultPlaceholderUrl('thumbnail');
152-
$fileHandler = $staticDir->stat(
153-
$this->getAssetRepo()->createAsset($this->getImageHelper()->getPlaceholder('thumbnail'))->getPath()
154-
);
155-
$image['size'] = $fileHandler['size'];
150+
$image['url'] = $this->getImageHelper()->getDefaultPlaceholderUrl('small_image');
151+
$image['size'] = 0;
156152
$this->_logger->warning($e);
157153
}
158154
}

0 commit comments

Comments
 (0)