Skip to content

Commit

Permalink
bug-fix #16074 Restore current theme once the images creation is
Browse files Browse the repository at this point in the history
emulated.
  • Loading branch information
drew7721 committed Nov 9, 2018
1 parent b8940db commit fd26b94
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -120,6 +123,7 @@ public function collect(ProductInterface $product, ProductRenderInterface $produ
$images[] = $image;
}

$this->design->setDesignTheme($currentTheme);
$productRender->setImages($images);
}

Expand Down

0 comments on commit fd26b94

Please sign in to comment.