magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Trying to access array offset on value of type null in BulkInventoryTransfer.php on line 131 #37743

Closed dennismetz closed 1 year ago

dennismetz commented 1 year ago

Preconditions and environment

Magento version 2.4.5-p3 PHP8.1.x Apache/NGINX, both

Steps to reproduce

Under Stores->Sources add new Source. Under Stores->Stocks add new Stock (Main Website, Assign new Source from above)

Go to catalog -> products -> select 2 or more products (one with assigned source, one without) -> Actions -> Transfer Inventory to Source. Transfer from the origin source to the destination source. Check (or check not) "Unassign the origin source from selected products after transfer." Hit "Transfer Inventory" button.

Expected result

Display Error Message like: Selected products are not assigned to any source.

Actual result

Warning: Trying to access array offset on value of type null in vendor/magento/module-inventory-catalog/Model/ResourceModel/BulkInventoryTransfer.php on line 131

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @dennismetz. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo, here is your Magento Instance: https://945583b270f48e58b51299bc4e280a5a.instances-prod.magento-community.engineering Admin access: https://945583b270f48e58b51299bc4e280a5a.instances-prod.magento-community.engineering/admin_314e Login: 72d5582e Password: de21c09f92d4

engcom-Bravo commented 1 year ago

Hi @dennismetz,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the attached vidoe.

Steps to reproduce

https://github.com/magento/magento2/assets/51680745/e26c5ccb-4bf3-46cc-a782-281bb1f14b78

We are not getting error.for one of the product we are not assigned any source.

As per this document https://experienceleague.adobe.com/docs/commerce-admin/inventory/quantities/inventory-transfer.html?lang=en. every product should have assigned source otherwise the product will be skipped.Kindly refer this document.

Screenshot 2023-07-11 at 12 28 08 PM

Kindly recheck the behaviour on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.

Thanks.

engcom-Bravo commented 1 year ago

Hi @dennismetz,

Kindly provide latest update on this comment https://github.com/magento/magento2/issues/37743#issuecomment-1630262520 still you are working on the issue if you are able to reproduce the issue please elaborate the steps to reproduce and let us know if you are still facing any issue.

Thanks.

engcom-Bravo commented 1 year ago

Hi @dennismetz,

We have noticed that this issue has not been updated since long time.
Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.

MihaiComan90 commented 1 year ago

@engcom-Bravo i can validate that this issue is still reproducible for Magento 2.4.6-p1 so it is valid with the steps provided above.

arion-p commented 3 months ago

I can also validate the issue in 2.4.6-p1. Furthermore, if some (but not all) of the products are assigned to the "from" source, ALL products are skipped not just the ones without the source (i.e. the entire operation is aborted).