diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php
index a0f1e25cf6512..84c3e7e7b5f5a 100644
--- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php
+++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php
@@ -2042,6 +2042,7 @@ protected function uploadMediaFiles($fileName, $renameFileOff = false)
$res = $this->_getUploader()->move($fileName, $renameFileOff);
return $res['file'];
} catch (\Exception $e) {
+ $this->_logger->critical($e);
return '';
}
}
diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php
index 862276d35bac5..8461e3830cbec 100644
--- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php
+++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php
@@ -1194,6 +1194,70 @@ public function testParseAttributesWithWrappedValuesWillReturnsLowercasedAttribu
$this->assertArrayNotHasKey('PARAM2', $attributes);
}
+ /**
+ * Test that errors occurred during importing images are logged.
+ *
+ * @param string $fileName
+ * @param bool $throwException
+ * @dataProvider uploadMediaFilesDataProvider
+ */
+ public function testUploadMediaFiles(string $fileName, bool $throwException)
+ {
+ $exception = new \Exception();
+ $expectedFileName = $fileName;
+ if ($throwException) {
+ $expectedFileName = '';
+ $this->_logger->expects($this->once())->method('critical')->with($exception);
+ }
+
+ $fileUploaderMock = $this
+ ->getMockBuilder(\Magento\CatalogImportExport\Model\Import\Uploader::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $fileUploaderMock
+ ->expects($this->once())
+ ->method('move')
+ ->willReturnCallback(
+ function ($name) use ($throwException, $exception) {
+ if ($throwException) {
+ throw $exception;
+ }
+ return ['file' => $name];
+ }
+ );
+
+ $this->setPropertyValue(
+ $this->importProduct,
+ '_fileUploader',
+ $fileUploaderMock
+ );
+
+ $actualFileName = $this->invokeMethod(
+ $this->importProduct,
+ 'uploadMediaFiles',
+ [$fileName]
+ );
+
+ $this->assertEquals(
+ $expectedFileName,
+ $actualFileName
+ );
+ }
+
+ /**
+ * Data provider for testUploadMediaFiles.
+ *
+ * @return array
+ */
+ public function uploadMediaFilesDataProvider()
+ {
+ return [
+ ['test1.jpg', false],
+ ['test2.jpg', true],
+ ];
+ }
+
public function getImagesFromRowDataProvider()
{
return [
diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php
index 8da1bb1763ece..092b721b82435 100644
--- a/app/code/Magento/ImportExport/Model/Import.php
+++ b/app/code/Magento/ImportExport/Model/Import.php
@@ -567,7 +567,6 @@ public function validateSource(\Magento\ImportExport\Model\Import\AbstractSource
ProcessingError::ERROR_LEVEL_CRITICAL,
null,
null,
- null,
$e->getMessage()
);
}
diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php
index 6e2265315245d..74f3eebf8fcb9 100644
--- a/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php
+++ b/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php
@@ -75,12 +75,12 @@ public function __construct(
protected function _drawHeader(\Zend_Pdf_Page $page)
{
$this->_setFontRegular($page, 10);
- $page->setFillColor(new \Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
+ $page->setFillColor(new \Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
$page->setLineColor(new \Zend_Pdf_Color_GrayScale(0.5));
$page->setLineWidth(0.5);
$page->drawRectangle(25, $this->y, 570, $this->y - 30);
$this->y -= 10;
- $page->setFillColor(new \Zend_Pdf_Color_RGB(0, 0, 0));
+ $page->setFillColor(new \Zend_Pdf_Color_Rgb(0, 0, 0));
//columns headers
$lines[0][] = ['text' => __('Products'), 'feed' => 35];
diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php
index 2912969a99718..f294128a72f9f 100644
--- a/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php
+++ b/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php
@@ -82,12 +82,12 @@ protected function _drawHeader(\Zend_Pdf_Page $page)
{
/* Add table head */
$this->_setFontRegular($page, 10);
- $page->setFillColor(new \Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
+ $page->setFillColor(new \Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
$page->setLineColor(new \Zend_Pdf_Color_GrayScale(0.5));
$page->setLineWidth(0.5);
$page->drawRectangle(25, $this->y, 570, $this->y - 15);
$this->y -= 10;
- $page->setFillColor(new \Zend_Pdf_Color_RGB(0, 0, 0));
+ $page->setFillColor(new \Zend_Pdf_Color_Rgb(0, 0, 0));
//columns headers
$lines[0][] = ['text' => __('Products'), 'feed' => 35];
diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php b/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php
index be74efda2d265..b171fccdeb05b 100644
--- a/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php
+++ b/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php
@@ -80,12 +80,12 @@ protected function _drawHeader(\Zend_Pdf_Page $page)
{
/* Add table head */
$this->_setFontRegular($page, 10);
- $page->setFillColor(new \Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
+ $page->setFillColor(new \Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
$page->setLineColor(new \Zend_Pdf_Color_GrayScale(0.5));
$page->setLineWidth(0.5);
$page->drawRectangle(25, $this->y, 570, $this->y - 15);
$this->y -= 10;
- $page->setFillColor(new \Zend_Pdf_Color_RGB(0, 0, 0));
+ $page->setFillColor(new \Zend_Pdf_Color_Rgb(0, 0, 0));
//columns headers
$lines[0][] = ['text' => __('Products'), 'feed' => 100];
diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/filters.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/filters.html
index 2af1a430a6e00..eab2523b06e41 100644
--- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/filters.html
+++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/filters.html
@@ -14,7 +14,7 @@
-
+