Skip to content

Commit c46d366

Browse files
committed
Merge remote-tracking branch 'origin/AC-13917-3' into cia-2.4.9-alpha1-develop-bugfix-04282025
2 parents c0d6865 + d127336 commit c46d366

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

app/code/Magento/Quote/Plugin/ValidateQuoteOrigOrder.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
<?php
2-
/**
3-
* Copyright 2024 Adobe
2+
/************************************************************************
3+
* Copyright 2025 Adobe
44
* All Rights Reserved.
5+
*
6+
* NOTICE: All information contained herein is, and remains
7+
* the property of Adobe and its suppliers, if any. The intellectual
8+
* and technical concepts contained herein are proprietary to Adobe
9+
* and its suppliers and are protected by all applicable intellectual
10+
* property laws, including trade secret and copyright laws.
11+
* Dissemination of this information or reproduction of this material
12+
* is strictly forbidden unless prior written permission is obtained
13+
* from Adobe.
14+
* ***********************************************************************
515
*/
616

717
declare(strict_types=1);
@@ -45,10 +55,10 @@ public function beforeSave(
4555
CartRepositoryInterface $cartRepository,
4656
CartInterface $quote
4757
): void {
48-
if ($orderId = $quote->getOrigOrderId()) {
49-
$order = $this->orderRepository->get($orderId);
58+
if ($quote->getOrigOrderId() && $quote->getCustomerId()) {
59+
$order = $this->orderRepository->get((int)$quote->getOrigOrderId());
5060
$orderCustomer = (int)$order->getCustomerId();
51-
if ($quote->getCustomerId() !== $orderCustomer) {
61+
if ((int)$quote->getCustomerId() !== $orderCustomer) {
5262
throw new NoSuchEntityException(__('Please check input parameters.'));
5363
}
5464
}

app/code/Magento/Quote/etc/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,7 @@
184184
</argument>
185185
</arguments>
186186
</type>
187+
<type name="Magento\Quote\Api\CartRepositoryInterface">
188+
<plugin name="quoteValidateOrderId" type="Magento\Quote\Plugin\ValidateQuoteOrigOrder"/>
189+
</type>
187190
</config>

app/code/Magento/Quote/etc/webapi_rest/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
<plugin name="updateQuoteStoreId" type="Magento\Quote\Model\Quote\Plugin\UpdateQuoteStoreId" />
2121
<plugin name="validateQuoteAddress" type="Magento\Quote\Plugin\QuoteAddress" />
2222
</type>
23-
<type name="Magento\Quote\Api\CartRepositoryInterface">
24-
<plugin name="quoteValidateOrderId" type="Magento\Quote\Plugin\ValidateQuoteOrigOrder"/>
25-
</type>
2623
<type name="Magento\Quote\Model\QuoteValidator">
2724
<plugin name="error_redirect_processor" type="Magento\Quote\Plugin\Webapi\Model\ErrorRedirectProcessor" />
2825
</type>

0 commit comments

Comments
 (0)