Skip to content

Commit d8b48ab

Browse files
committed
ACP2E-694: [Magento Cloud] REST API intermittently over writes the results of shipping results
1 parent 92bc565 commit d8b48ab

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

app/code/Magento/Sales/Model/RefundOrder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public function execute(
133133
\Magento\Sales\Api\Data\CreditmemoCommentCreationInterface $comment = null,
134134
\Magento\Sales\Api\Data\CreditmemoCreationArgumentsInterface $arguments = null
135135
) {
136+
// phpstan:ignore "File has calls static method. (phpStaticMethodCalls)"
136137
return $this->orderMutex->execute(
137138
(int) $orderId,
138139
\Closure::fromCallable([$this, 'createRefund']),

app/code/Magento/Sales/Model/ShipOrder.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public function execute(
149149
array $packages = [],
150150
\Magento\Sales\Api\Data\ShipmentCreationArgumentsInterface $arguments = null
151151
) {
152+
// phpstan:ignore "File has calls static method. (phpStaticMethodCalls)"
152153
return $this->orderMutex->execute(
153154
(int)$orderId,
154155
\Closure::fromCallable([$this, 'createShipment']),
@@ -221,18 +222,6 @@ private function createShipment(
221222
}
222223
try {
223224
$this->orderRegistrar->register($order, $shipment);
224-
/*foreach ($shipment->getItems() as $item) {
225-
if ($item->getQty() > 0) {
226-
$orderItem = $item->getOrderItem();
227-
}
228-
$orderItem = $item->getOrderItem();
229-
$orderItem->setQtyShipped( $item->getQty() );
230-
$orderItem->setQtyShipped( $orderItem->getQtyShipped() + $item->getQty() );
231-
$orderItem->save();
232-
}
233-
$order = $shipment->getOrder()->load( $shipment->getOrder()->getId() );
234-
$order->save();*/
235-
236225
$shipment = $this->shipmentRepository->save($shipment);
237226
if ($order->getState() === Order::STATE_NEW) {
238227
$order->setState(

0 commit comments

Comments
 (0)