From 1becee9bb4114318c89f54b45c10b6b60cdc9cee Mon Sep 17 00:00:00 2001 From: Alex Ghiban Date: Thu, 8 Nov 2018 16:38:02 -0500 Subject: [PATCH 1/5] bug-fix #16074 - Fix setting the default theme in the middle of the product page, regardless of the design exception. --- .../Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php index 216bc16968fcb..663fbbacf960d 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php @@ -136,7 +136,6 @@ public function collect(ProductInterface $product, ProductRenderInterface $produ public function emulateImageCreating(ProductInterface $product, $imageCode, $storeId, ImageInterface $image) { $this->storeManager->setCurrentStore($storeId); - $this->design->setDefaultDesignTheme(); $imageHelper = $this->imageFactory->create(); $imageHelper->init($product, $imageCode); From b8940db9514c672c9e191bbb33172884a524a993 Mon Sep 17 00:00:00 2001 From: Alex Ghiban Date: Fri, 9 Nov 2018 02:46:30 -0500 Subject: [PATCH 2/5] Revert "bug-fix #16074 - Fix setting the default theme in the middle of the" This reverts commit 1becee9bb4114318c89f54b45c10b6b60cdc9cee. --- .../Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php index 663fbbacf960d..216bc16968fcb 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php @@ -136,6 +136,7 @@ public function collect(ProductInterface $product, ProductRenderInterface $produ public function emulateImageCreating(ProductInterface $product, $imageCode, $storeId, ImageInterface $image) { $this->storeManager->setCurrentStore($storeId); + $this->design->setDefaultDesignTheme(); $imageHelper = $this->imageFactory->create(); $imageHelper->init($product, $imageCode); From fd26b94dc1950845a135879937ce7ce0d8f8b8b4 Mon Sep 17 00:00:00 2001 From: Alex Ghiban Date: Fri, 9 Nov 2018 02:50:37 -0500 Subject: [PATCH 3/5] bug-fix #16074 Restore current theme once the images creation is emulated. --- .../Ui/DataProvider/Product/Listing/Collector/Image.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php index 216bc16968fcb..ae2b96e6e838b 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php @@ -14,6 +14,7 @@ use Magento\Catalog\Model\Product\Image\NotLoadInfoImageException; use Magento\Catalog\Ui\DataProvider\Product\ProductRenderCollectorInterface; use Magento\Framework\App\State; +use Magento\Framework\View\Design\ThemeInterface; use Magento\Framework\View\DesignInterface; use Magento\Store\Model\StoreManager; use Magento\Store\Model\StoreManagerInterface; @@ -92,6 +93,8 @@ public function __construct( public function collect(ProductInterface $product, ProductRenderInterface $productRender) { $images = []; + /** @var ThemeInterface $currentTheme */ + $currentTheme = $this->design->getDesignTheme(); foreach ($this->imageCodes as $imageCode) { /** @var ImageInterface $image */ @@ -120,6 +123,7 @@ public function collect(ProductInterface $product, ProductRenderInterface $produ $images[] = $image; } + $this->design->setDesignTheme($currentTheme); $productRender->setImages($images); } From 47e42a969d443715bf483f9e90eabfd2a141c930 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Mon, 12 Nov 2018 17:57:46 -0600 Subject: [PATCH 4/5] ENGCOM-3448: bug-fix #16074 - Fix theme change in middle of product page. #19124 - Fixed docblock --- .../Ui/DataProvider/Product/Listing/Collector/Image.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php index ae2b96e6e838b..ef86e1727c447 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php @@ -23,7 +23,6 @@ * Collect enough information about image rendering on front * If you want to add new image, that should render on front you need * to configure this class in di.xml - * */ class Image implements ProductRenderCollectorInterface { @@ -128,6 +127,8 @@ public function collect(ProductInterface $product, ProductRenderInterface $produ } /** + * Emulate image creation + * * Callback in which we emulate initialize default design theme, depends on current store, be settings store id * from render info * From 4b6100d1e991fc56f7ff9f8e0f0be0db7192328e Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Tue, 13 Nov 2018 10:24:56 -0600 Subject: [PATCH 5/5] ENGCOM-3448: bug-fix #16074 - Fix theme change in middle of product page. #19124 - Fixed docblock --- .../Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php index ef86e1727c447..b0ce31eedf8b0 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php @@ -128,7 +128,7 @@ public function collect(ProductInterface $product, ProductRenderInterface $produ /** * Emulate image creation - * + * * Callback in which we emulate initialize default design theme, depends on current store, be settings store id * from render info *