magento / magento/inventory

Existing Item Quantities at (default)Source set to zero when saving product images with gallery management

Open
#2,058 5 comments 0 reactions 0 assignees View on GitHub
Bug Ready for QA
Dominant language
PHP
Stars
357
Forks
262
PR merge metrics
No merged PRs in 30d

Description

### Preconditions

1. Magento 2.3
2. MSI 1.1.0
3. php 7.2
4. single store mode ("default" source only)
### Steps to reproduce

1. create new simple product with ProductInterfaceFactory
2. save with product repository (no stock data set yet)
3. save inventory to "default" source with:
Magento\InventoryApi\Api\SourceItemsSaveInterface
4. inventory successfully saves
5. add images to product using:
'Magento\Catalog\Model\Product\Gallery\GalleryManagement'
6. Product inventory for "default" source, gets set to ZERO.

This was super freaking tedious to debug.

If you save images FIRST with gallery management, and then set stock values after, stock quantities will not be set to 0 and things work as expected.

### Expected result

1.

### Actual result

1. [Screenshots, logs or description]
2.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with ProductInterfaceFactory, SourceItemsSaveInterface, and Product\Gallery\GalleryManagement in the Magento 2.3/MSI 1.1.0 setup described. Trace the product save and source-item handling after gallery management is called, then verify that an existing default-source quantity remains unchanged when images are added.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.