magento / inventory

Magento Inventory Project (a.k.a MSI)
Open Software License 3.0
337 stars 248 forks source link

Notice: Undefined offset: 0 in vendor/magento/module-inventory-configurable-product-admin-ui/Observer/ProcessSourceItemsObserver.php on line 83 #3365

Open ioweb-gr opened 2 years ago

ioweb-gr commented 2 years ago

Preconditions (*)

  1. 2.4.1
  2. One configurable product and children with sources assigned
  3. Multiple websites and store views E.g.

image

Steps to reproduce (*)

  1. Try to save the configurable product in a different store view than the Default

image

Expected result (*)

  1. Product is saved correctly

Actual result (*)

  1. The product is saved but a notice appears

image

I've tried debugging this a bit and it seems that in line vendor/magento/module-inventory-configurable-product-admin-ui/Observer/ProcessSourceItemsObserver.php:75

The productsData array is indexed by 0...N

image

But later on the function $product->getExtensionAttributes()->getConfigurableProductLinks()

Will return an array indexed by the productId and not with a number 0...N

image

However when repeating this on the default store view the case is different and everything works fine.

image

Any ideas why it's loading the product links differently per store?

m2-assistant[bot] commented 2 years ago

Hi @ioweb-gr. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this