You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Magento\Catalog\Model\Product\Gallery\Processor: addImage function to add an image to a product.
Expected result
Image should get added.
Actual result
Message: Notice: Undefined index: media_type in /vendor/magento/module-catalog/Model/Product.php on line 2554
We have tried to find the comparison between 2.2.1 and 2.2.2. We got this which is causing issue:
in addImage function:(media_type) is missing which is causing issue.
Please check.
The text was updated successfully, but these errors were encountered:
if we use $product->addImageToMediaGallery(params); and then $product->save() function to add images.
still we are getting error: Message: Notice: Undefined index: media_type in /vendor/magento/module-catalog/Model/Product.php on line 2554
@ankursachdeva11, thank you for your report.
This seems to be correct Magento behavior. Please refer to the Community Forums or the Magento Stack Exchange site for advice or general discussion about this.
Otherwise you may submit Pull Request with the suggested changes.
Preconditions
Steps to reproduce
Expected result
Actual result
We have tried to find the comparison between 2.2.1 and 2.2.2. We got this which is causing issue:

in addImage function:(media_type) is missing which is causing issue.
Please check.
The text was updated successfully, but these errors were encountered: