Closed siimm closed 4 years ago
@siimm, thank you for your report. We've acknowledged the issue and added to our backlog.
I am working on this at #dmcdindia
Does anyone know if this is fixed in 2.2.6 ?
Does anyone know if this is fixed in 2.2.6 ?
@michaelbakertup the issue is still there
AFAIK the preferred endpoint for creating shipments is POST /V1/order/{orderId}/ship
.
Hi @engcom-Alfa. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
[ ] 1. Add/Edit Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 2. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.
Hi @siimm. We are not able to reproduce this issue on fresh 2.4-develop instance. Everything works correctly.
Manual testing scenario:
{ "entity":{ "order_id":3, "items": [ { "order_item_id": 3, "qty": 1 } ], "comments": [ { "is_customer_notified": 1, "comment" : "this is a comment for order #3" } ], "tracks": [ { "track_number": "2Y-987651110", "title": "United Parcel Service", "carrier_code": "ups", "order_id":3, "extension_attributes" : {} } ] } }
Actual Result:
A shipment is created with a comment added and tracking attached
So, we have to close it.
Please feel free to comment, reopen or create new ticket according to the Issue reporting guidelines
if you are still facing this issue on the latest 2.4-develop
branch. Thank you for collaboration.
Preconditions
Steps to reproduce
{ "entity":{ "order_id":3, "items": [ { "order_item_id": 3, "qty": 1 } ], "comments": [ { "is_customer_notified": 1, "comment" : "this is a comment for order #3" } ], "tracks": [ { "track_number": "2Y-987651110", "title": "United Parcel Service", "carrier_code": "ups", "order_id":3, "extension_attributes" : {} } ] } }
Request with better formatting as a gist: https://gist.github.com/siimm/d4f2f6644e0d1255cbe4339bb42084e2Expected result
Actual result
General background:
Upon saving the shipment relations in Magento\Sales\Model\ResourceModel\Order\Shipment\Relation::processRelation() $object->getTracksCollection() is consulted, while during the API request $object->setTracks() is used and it is not set as a collection
As a solution getTracks() should also be processed in Relation class, or the tacks should be added using addTarck() method on Shipping model (which initialises the collection of tracks)