Skip to content

Commit 7c1dc2e

Browse files
committed
MC-41981: [Magento Cloud] Reorder Not Working On Storefront
1 parent ec2dea5 commit 7c1dc2e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

app/code/Magento/Sales/Model/AdminOrder/Create.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,10 @@ public function initFromOrderItem(\Magento\Sales\Model\Order\Item $orderItem, $q
688688
try {
689689
$formattedOptions[$option['option_id']] =
690690
$this->serializer->unserialize($option['option_value']);
691+
continue;
691692
} catch (\InvalidArgumentException $exception) {
692-
//do nothing
693+
//log the exception as warning
694+
$this->_logger->warning($exception);
693695
}
694696
}
695697
$formattedOptions[$option['option_id']] =

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ class Reorder
9494
private $guestCartResolver;
9595

9696
/**
97-
* @var
97+
* @var SerializerInterface
9898
*/
99-
private $jsonSerializer;
99+
private $serializer;
100100

101101
/**
102102
* @param OrderFactory $orderFactory
@@ -124,7 +124,7 @@ public function __construct(
124124
$this->customerCartProvider = $customerCartProvider;
125125
$this->guestCartResolver = $guestCartResolver;
126126
$this->productCollectionFactory = $productCollectionFactory;
127-
$this->jsonSerializer = $serializer;
127+
$this->serializer = $serializer;
128128
}
129129

130130
/**
@@ -365,10 +365,11 @@ private function getInfoBuyRequest(OrderItemInterface $orderItem): ?array
365365
foreach ($options as $option) {
366366
if (array_key_exists($option['option_id'], $info['options'])) {
367367
try {
368-
$value = $this->jsonSerializer->unserialize($option['option_value']);
368+
$value = $this->serializer->unserialize($option['option_value']);
369369
$info['options'][$option['option_id']] = $value;
370370
} catch (\InvalidArgumentException $exception) {
371-
//do nothing
371+
//log the exception as warning
372+
$this->_logger->warning($exception);
372373
}
373374
}
374375
}

0 commit comments

Comments
 (0)