File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
app/code/Magento/CatalogGraphQl/Plugin/Product Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \CatalogGraphQl \Plugin \Product ;
9
9
10
+ use Magento \Catalog \Api \ProductRepositoryInterface ;
10
11
use Magento \Catalog \Model \Product ;
11
12
use Magento \CatalogGraphQl \Model \Resolver \Cache \Product \MediaGallery \ResolverCacheIdentity ;
12
13
use Magento \Framework \Serialize \SerializerInterface ;
17
18
*/
18
19
class UpdateIdentities
19
20
{
21
+ /**
22
+ * @var ProductRepositoryInterface
23
+ */
24
+ private $ productRepository ;
25
+
20
26
/**
21
27
* @var SerializerInterface
22
28
*/
23
29
private $ serializer ;
24
30
25
31
/**
32
+ * @param ProductRepositoryInterface $productRepository
26
33
* @param SerializerInterface $serializer
27
34
*/
28
- public function __construct (SerializerInterface $ serializer )
29
- {
35
+ public function __construct (
36
+ ProductRepositoryInterface $ productRepository ,
37
+ SerializerInterface $ serializer
38
+ ) {
39
+ $ this ->productRepository = $ productRepository ;
30
40
$ this ->serializer = $ serializer ;
31
41
}
32
42
@@ -57,7 +67,12 @@ private function isMediaGalleryChanged(Product $product): bool
57
67
return false ;
58
68
}
59
69
60
- $ mediaGalleryImages = $ product ->getMediaGallery ('images ' ) ?? [];
70
+ $ mediaGalleryImages = $ this ->productRepository ->get (
71
+ $ product ->getSku (),
72
+ false ,
73
+ null ,
74
+ true
75
+ )->getMediaGallery ('images ' ) ?? [];
61
76
62
77
$ origMediaGalleryImages = $ product ->getOrigData ('media_gallery ' )['images ' ] ?? [];
63
78
You can’t perform that action at this time.
0 commit comments