Skip to content

creating new shipment: gettting all trackers. after this commit 2307e16 #19887

Closed
@aldf

Description

@aldf

Preconditions (*)

  1. Magento 2.3-develop

Steps to reproduce (*)

  1. After I pulled 2.3-dev brunch to my code, this commit effected creating new order shipment.
  2. after creating new shipment and exec $_shipment->getAllTracks()
    in https://example.com/admin_xxxxx/admin/order_shipment/view/shipment_id/382
    after tick Notify Customer by Email and click save
    the customer receive email with all my tracking number
  3. also if the order converted to shipment \Magento\Sales\Model\Convert\Order->toShipment($order);
    then $shipment->getAllTracks() will return all trackers

Expected result (*)

  1. return trackers if they already exist or empty array if not exist

Actual result (*)

  1. return all tracker in sales_shipment_track table
    image

my temporary fix that work

1- in app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml

<?php $_shipment = $block->getShipment() ?>
// my fix
<?php $_shipment->getTracksCollection()->addFieldToFilter('parent_id',array('eq' =>$_shipment->getId())); ?>
  1. in Controller/Adminhtml/Order/Pdfshipments.php

$convertOrder = $objectManager->create('Magento\Sales\Model\Convert\Order');
$shipment = $convertOrder->toShipment($order);
// fix the issue after convert get all shipment trackers
$shipment->getTracksCollection()->addFieldToFilter('parent_id',array('eq' =>$shipment->getId()));

Metadata

Metadata

Assignees

Labels

Component: ShippingFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions