"Shipment items" always show all items even that item is shipped

Created on 19 January 2023, over 1 year ago
Updated 9 June 2023, about 1 year ago

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

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I 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,

  • Status changed to Needs review about 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    149 pass
  • @abx opened merge request.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.1 & MariaDB 10.3.22
    last update 7 months ago
    140 pass, 2 fail
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 7 months ago
    149 pass
Production build 0.69.0 2024