Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: media_type while addImage to product #14407

Closed
ankursachdeva11 opened this issue Mar 28, 2018 · 3 comments
Closed

Undefined index: media_type while addImage to product #14407

ankursachdeva11 opened this issue Mar 28, 2018 · 3 comments
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed non-issue

Comments

@ankursachdeva11
Copy link

Preconditions

  1. Magento 2.2.1 CE

Steps to reproduce

  1. Use Magento\Catalog\Model\Product\Gallery\Processor: addImage function to add an image to a product.

Expected result

  1. Image should get added.

Actual result

  1. 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.
image

Please check.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Mar 28, 2018
@ankursachdeva11
Copy link
Author

In Addition to this,

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

@magento-engcom-team
Copy link
Contributor

@ankursachdeva11 , thank you for your report . Duplicate of #6803

@magento-engcom-team
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed non-issue
Projects
None yet
Development

No branches or pull requests

2 participants