Skip to content

Commit 0d9b972

Browse files
MAGETWO-86595: #12705: Integrity constraint violation error after re… #13036
2 parents c87d925 + 8f634b0 commit 0d9b972

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/code/Magento/ConfigurableProductSales/Model/Order/Reorder/OrderedProductAvailabilityChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(
4545
public function isAvailable(Item $item)
4646
{
4747
$buyRequest = $item->getBuyRequest();
48-
$superAttribute = $buyRequest->getData()['super_attribute'];
48+
$superAttribute = $buyRequest->getData()['super_attribute'] ?? [];
4949
$connection = $this->getConnection();
5050
$select = $connection->select();
5151
$orderItemParentId = $item->getParentItem()->getProductId();

app/code/Magento/Quote/Model/Quote/Item.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,9 @@ public function saveItemOptions()
745745
unset($this->_options[$index]);
746746
unset($this->_optionsByCode[$option->getCode()]);
747747
} else {
748+
if (!$option->getItem() || !$option->getItem()->getId()) {
749+
$option->setItem($this);
750+
}
748751
$option->save();
749752
}
750753
}

0 commit comments

Comments
 (0)