From 24bed8d5c1d4eb8f2bd520de6e233ee6bfc1feeb Mon Sep 17 00:00:00 2001 From: Vincent MARMIESSE Date: Mon, 29 Jan 2018 17:37:52 +0100 Subject: [PATCH] Add product ID to image builder --- app/code/Magento/Catalog/Block/Product/ImageBuilder.php | 1 + .../Catalog/Test/Unit/Block/Product/ImageBuilderTest.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/code/Magento/Catalog/Block/Product/ImageBuilder.php b/app/code/Magento/Catalog/Block/Product/ImageBuilder.php index b752000f5a19d..f1149f15c41d3 100644 --- a/app/code/Magento/Catalog/Block/Product/ImageBuilder.php +++ b/app/code/Magento/Catalog/Block/Product/ImageBuilder.php @@ -146,6 +146,7 @@ public function create() 'custom_attributes' => $this->getCustomAttributes(), 'resized_image_width' => $imagesize[0], 'resized_image_height' => $imagesize[1], + 'product_id' => $this->product->getId() ], ]; diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ImageBuilderTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ImageBuilderTest.php index dc152aaf05867..3094b423a4be4 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ImageBuilderTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ImageBuilderTest.php @@ -252,6 +252,7 @@ private function getTestDataWithoutAttributes(): array 'custom_attributes' => '', 'resized_image_width' => 100, 'resized_image_height' => 100, + 'product_id' => null ], ], ]; @@ -286,6 +287,7 @@ private function getTestDataWithAttributes(): array 'custom_attributes' => 'name_1="value_1" name_2="value_2"', 'resized_image_width' => 120, 'resized_image_height' => 70, + 'product_id' => null ], ], ];