Skip to content

Commit b9bae61

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into AC-13818
2 parents fb8e83b + 2b17d9b commit b9bae61

File tree

40 files changed

+993
-770
lines changed

40 files changed

+993
-770
lines changed

app/code/Magento/CatalogInventory/Model/StockStateProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\CatalogInventory\Model;
@@ -159,7 +159,7 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQ
159159
if (!$stockItem->getIsInStock()) {
160160
$result->setHasError(true)
161161
->setErrorCode('out_stock')
162-
->setMessage(__('This product is out of stock.'))
162+
->setMessage(__('Product %name is out of stock.', ['name' => $stockItem->getProductName()]))
163163
->setQuoteMessage(__('Some of the products are out of stock.'))
164164
->setQuoteMessageIndex('stock');
165165
$result->setItemUseOldQty(true);

app/code/Magento/CatalogInventory/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ Stock,Stock
7777
"Only %s of %s available","Only %s of %s available"
7878
"Not enough items for sale","Not enough items for sale"
7979
"The requested qty. is not available","The requested qty. is not available"
80+
"Product %name is out of stock.","Product %name is out of stock."

app/code/Magento/Csp/Test/Unit/Plugin/StoreAssetIntegrityHashesTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2024 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -62,7 +62,6 @@ protected function setUp(): void
6262
* Test After Deploy method of plugin
6363
*
6464
* @return void
65-
* @doesNotPerformAssertions
6665
*/
6766
public function testAfterDeploy(): void
6867
{

app/code/Magento/Customer/Test/Unit/Model/AccountManagementApiTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2023 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -433,8 +433,6 @@ public function testBeforeCreateAccount(
433433
): void {
434434
if ($willThrowException) {
435435
$this->expectException(AuthorizationException::class);
436-
} else {
437-
$this->expectNotToPerformAssertions();
438436
}
439437
$this->authorizationMock
440438
->expects($this->once())

app/code/Magento/Customer/Test/Unit/Plugin/AsyncRequestCustomerGroupAuthorizationTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2023 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -86,7 +86,6 @@ public function testBeforePublishMass(
8686
[$customer, 'Password1', '']
8787
];
8888
$this->authorizationMock
89-
->expects($this->once())
9089
->method('isAllowed')
9190
->with('Magento_Customer::manage')
9291
->willReturn($isAllowed);

app/code/Magento/OrderCancellation/Model/Email/ConfirmationKeySender.php

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,36 +51,28 @@ public function __construct(
5151
* Send email to guest user with confirmation key.
5252
*
5353
* @param Order $order
54-
* @param string $confirmationKey
54+
* @param array $confirmationDetails
5555
* @return void
5656
* @throws LocalizedException
5757
*/
5858
public function execute(
5959
Order $order,
60-
string $confirmationKey,
60+
array $confirmationDetails
6161
):void {
6262
try {
6363
$storeId = (int)$order->getStoreId();
64-
$guestOrderUrl = $this->url->getUrl(
65-
self::ORDER_VIEW_PATH,
66-
[
67-
'_query' => [
68-
'confirmation_key' => $confirmationKey,
69-
'order_id' => $order->getIncrementId()
70-
]
71-
]
72-
);
73-
$templateParams = [
74-
'customer_name' => $order->getCustomerName(),
75-
'order_id' => $order->getIncrementId(),
76-
'guest_order_url' => $guestOrderUrl,
77-
'escaper' => $this->escaper,
78-
];
79-
8064
$this->transportBuilder
8165
->setTemplateIdentifier(self::TEMPLATE_ID)
8266
->setTemplateOptions(['area' => Area::AREA_FRONTEND, 'store' => $storeId])
83-
->setTemplateVars($templateParams)
67+
->setTemplateVars([
68+
'customer_name' => $order->getCustomerName(),
69+
'order_id' => $order->getIncrementId(),
70+
'guest_order_url' => $this->url->getUrl(
71+
self::ORDER_VIEW_PATH,
72+
['_query' => $confirmationDetails]
73+
),
74+
'escaper' => $this->escaper,
75+
])
8476
->setFromByScope($this->orderIdentity->getEmailIdentity(), $storeId)
8577
->addTo($order->getCustomerEmail(), $order->getCustomerName())
8678
->getTransport()

app/code/Magento/OrderCancellation/Model/ResourceModel/SalesOrderConfirmCancel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function get(int $orderId): ?array
4040
$connection = $this->resourceConnection->getConnection();
4141
return $connection->fetchRow(
4242
$connection->select()->from(
43-
self::TABLE_NAME
43+
$this->resourceConnection->getTableName(self::TABLE_NAME)
4444
)->where(
4545
'order_id = ?',
4646
$orderId
@@ -60,7 +60,7 @@ public function insert(int $orderId, string $confirmationKey, string $reason): v
6060
{
6161
$connection = $this->resourceConnection->getConnection();
6262
$connection->insertOnDuplicate(
63-
self::TABLE_NAME,
63+
$this->resourceConnection->getTableName(self::TABLE_NAME),
6464
[
6565
'order_id' => $orderId,
6666
'confirmation_key' => $confirmationKey,

app/code/Magento/OrderCancellationGraphQl/Model/CancelOrderGuest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\OrderCancellationGraphQl\Model;
99

1010
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\GraphQl\Query\Uid;
1112
use Magento\OrderCancellation\Model\Email\ConfirmationKeySender;
1213
use Magento\OrderCancellation\Model\GetConfirmationKey;
1314
use Magento\Sales\Api\OrderRepositoryInterface;
@@ -23,12 +24,14 @@ class CancelOrderGuest
2324
* @param OrderRepositoryInterface $orderRepository
2425
* @param ConfirmationKeySender $confirmationKeySender
2526
* @param GetConfirmationKey $confirmationKey
27+
* @param Uid $idEncoder
2628
*/
2729
public function __construct(
2830
private readonly OrderFormatter $orderFormatter,
2931
private readonly OrderRepositoryInterface $orderRepository,
3032
private readonly ConfirmationKeySender $confirmationKeySender,
3133
private readonly GetConfirmationKey $confirmationKey,
34+
private readonly Uid $idEncoder
3235
) {
3336
}
3437

@@ -65,7 +68,13 @@ public function execute(Order $order, array $input): array
6568
*/
6669
private function sendConfirmationKeyEmail(Order $order, string $reason): void
6770
{
68-
$this->confirmationKeySender->execute($order, $this->confirmationKey->execute($order, $reason));
71+
$this->confirmationKeySender->execute(
72+
$order,
73+
[
74+
'order_id' => $this->idEncoder->encode((string)$order->getEntityId()),
75+
'confirmation_key' => $this->confirmationKey->execute($order, $reason)
76+
]
77+
);
6978

7079
// add comment in order about confirmation key send
7180
$order->addCommentToStatusHistory(

app/code/Magento/OrderCancellationGraphQl/Model/Resolver/CancelOrder.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\GraphQl\Config\Element\Field;
1212
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
1313
use Magento\Framework\GraphQl\Query\ResolverInterface;
14+
use Magento\Framework\GraphQl\Query\Uid;
1415
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1516
use Magento\OrderCancellation\Model\CancelOrder as CancelOrderAction;
1617
use Magento\OrderCancellationGraphQl\Model\Validator\ValidateOrder;
@@ -31,13 +32,15 @@ class CancelOrder implements ResolverInterface
3132
* @param OrderRepositoryInterface $orderRepository
3233
* @param CancelOrderAction $cancelOrderAction
3334
* @param ValidateOrder $validateOrder
35+
* @param Uid $idEncoder
3436
*/
3537
public function __construct(
3638
private readonly ValidateRequest $validateRequest,
3739
private readonly OrderFormatter $orderFormatter,
3840
private readonly OrderRepositoryInterface $orderRepository,
3941
private readonly CancelOrderAction $cancelOrderAction,
40-
private readonly ValidateOrder $validateOrder
42+
private readonly ValidateOrder $validateOrder,
43+
private readonly Uid $idEncoder
4144
) {
4245
}
4346

@@ -54,7 +57,7 @@ public function resolve(
5457
$this->validateRequest->execute($context, $args['input'] ?? []);
5558

5659
try {
57-
$order = $this->orderRepository->get($args['input']['order_id']);
60+
$order = $this->orderRepository->get($this->idEncoder->decode($args['input']['order_id']));
5861

5962
if ((int)$order->getCustomerId() !== $context->getUserId()) {
6063
throw new GraphQlAuthorizationException(__('Current user is not authorized to cancel this order'));

app/code/Magento/OrderCancellationGraphQl/Model/Resolver/ConfirmCancelOrder.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\Framework\GraphQl\Config\Element\Field;
1212
use Magento\Framework\GraphQl\Query\ResolverInterface;
13+
use Magento\Framework\GraphQl\Query\Uid;
1314
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1415
use Magento\OrderCancellationGraphQl\Model\ConfirmCancelOrder as ConfirmCancelOrderGuest;
1516
use Magento\OrderCancellationGraphQl\Model\Validator\ValidateOrder;
@@ -28,12 +29,14 @@ class ConfirmCancelOrder implements ResolverInterface
2829
* @param OrderRepositoryInterface $orderRepository
2930
* @param ConfirmCancelOrderGuest $confirmCancelOrder
3031
* @param ValidateOrder $validateOrder
32+
* @param Uid $idEncoder
3133
*/
3234
public function __construct(
3335
private readonly ValidateConfirmRequest $validateRequest,
3436
private readonly OrderRepositoryInterface $orderRepository,
3537
private readonly ConfirmCancelOrderGuest $confirmCancelOrder,
36-
private readonly ValidateOrder $validateOrder
38+
private readonly ValidateOrder $validateOrder,
39+
private readonly Uid $idEncoder
3740
) {
3841
}
3942

@@ -50,7 +53,7 @@ public function resolve(
5053
$this->validateRequest->execute($args['input'] ?? []);
5154

5255
try {
53-
$order = $this->orderRepository->get($args['input']['order_id']);
56+
$order = $this->orderRepository->get((int)$this->idEncoder->decode($args['input']['order_id']));
5457

5558
if (!$order->getCustomerIsGuest()) {
5659
return [

0 commit comments

Comments
 (0)