Problem/Motivation
When I tried to make multiple shipments, "Add Shipment" allow you to put information including what item will be shipped. When, I did "Send Shipment", that item should not show in "Add Shipment" screen since it is shipped. But what I got is the list of all items in that order shows.
Steps to reproduce
- Do a clean install of Commerce and setup.
- Make a test order
- "Add Shipment" to ship the item.
- "Finalize Shipment" and then "Send Shipment"
- Try to "Add Shipment" again, the list of item already been shipped still there.
Proposed resolution
When, items is shipped or packed, the list of item should not show in "Shipment items" to prevent a chance to make a mistake by send the same item twice or more.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork commerce_shipping-3334750
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
abx commentedI just have time to test this problem again and found that in "ShipmentForm.php", this line:
in_array($order_item->id(), $already_on_shipment, TRUE)) {cause the problem in this issue. I can either remove "TRUE" or convert a value to be the same type. I decided to convert it. So, the code will change to
in_array(intval($order_item->id()), $already_on_shipment, TRUE)) {Tested and work but since I don't know how to program, patch, etc. So, I hope, I did this correctly.
Thanks,
Comment #4
abx commentedComment #5
abx commentedComment #6
jsacksick commented