@@ -54,7 +54,7 @@ public function create($sku, ProductAttributeMediaGalleryEntryInterface $entry)
54
54
if (!$ this ->contentValidator ->isValid ($ entryContent )) {
55
55
throw new InputException (__ ('The image content is invalid. Verify the content and try again. ' ));
56
56
}
57
- $ product = $ this ->productRepository ->get ($ sku );
57
+ $ product = $ this ->productRepository ->get ($ sku, true );
58
58
59
59
$ existingMediaGalleryEntries = $ product ->getMediaGalleryEntries ();
60
60
$ existingEntryIds = [];
@@ -88,7 +88,7 @@ public function create($sku, ProductAttributeMediaGalleryEntryInterface $entry)
88
88
*/
89
89
public function update ($ sku , ProductAttributeMediaGalleryEntryInterface $ entry )
90
90
{
91
- $ product = $ this ->productRepository ->get ($ sku );
91
+ $ product = $ this ->productRepository ->get ($ sku, true );
92
92
$ existingMediaGalleryEntries = $ product ->getMediaGalleryEntries ();
93
93
if ($ existingMediaGalleryEntries == null ) {
94
94
throw new NoSuchEntityException (
@@ -129,7 +129,7 @@ public function update($sku, ProductAttributeMediaGalleryEntryInterface $entry)
129
129
*/
130
130
public function remove ($ sku , $ entryId )
131
131
{
132
- $ product = $ this ->productRepository ->get ($ sku );
132
+ $ product = $ this ->productRepository ->get ($ sku, true );
133
133
$ existingMediaGalleryEntries = $ product ->getMediaGalleryEntries ();
134
134
if ($ existingMediaGalleryEntries == null ) {
135
135
throw new NoSuchEntityException (
0 commit comments