Skip to content

Commit 07939a0

Browse files
authored
1.1.53 Release (#171)
1.1.53 Release
1 parent d8a53d6 commit 07939a0

14 files changed

+836
-801
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/quality-patches",
33
"description": "Provides quality patches for AdobeCommerce & Magento OpenSource",
44
"type": "magento2-component",
5-
"version": "1.1.52",
5+
"version": "1.1.53",
66
"license": "proprietary",
77
"repositories": {
88
"repo": {

patches-info.json

+1-1
Large diffs are not rendered by default.
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
diff --git a/vendor/magento/module-company/Model/Company/Delete.php b/vendor/magento/module-company/Model/Company/Delete.php
2+
index d190977d5862..11cc2aa2175a 100644
3+
--- a/vendor/magento/module-company/Model/Company/Delete.php
4+
+++ b/vendor/magento/module-company/Model/Company/Delete.php
5+
@@ -21,6 +21,8 @@
6+
7+
/**
8+
* Class for deleting a company entity.
9+
+ *
10+
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
11+
*/
12+
class Delete
13+
{
14+
@@ -150,6 +152,7 @@ private function detachCustomerFromCompany($customerId)
15+
$companyAttributes = $customer->getExtensionAttributes()->getCompanyAttributes();
16+
$companyAttributes->setCompanyId($this->noCompanyId);
17+
$companyAttributes->setStatus(CompanyCustomerInterface::STATUS_INACTIVE);
18+
+ $customer->setData('ignore_validation_flag', true);
19+
$this->customerRepository->save($customer);
20+
}
21+
}
22+
diff --git a/vendor/magento/module-company/Model/CompanySuperUserGet.php b/vendor/magento/module-company/Model/CompanySuperUserGet.php
23+
index 6be15b5f7c16..40eec97aaa46 100644
24+
--- a/vendor/magento/module-company/Model/CompanySuperUserGet.php
25+
+++ b/vendor/magento/module-company/Model/CompanySuperUserGet.php
26+
@@ -164,6 +164,7 @@ public function getUserForCompanyAdmin(array $data): CustomerInterface
27+
$companyAttributes->setStatus($customerStatus);
28+
}
29+
if ($customer->getId()) {
30+
+ $customer->setData('ignore_validation_flag', true);
31+
$customer = $this->customerRepository->save($customer);
32+
} else {
33+
if (!$customer->getCreatedIn()) {
34+
diff --git a/vendor/magento/module-company/Model/SaveHandler/CustomerGroup.php b/vendor/magento/module-company/Model/SaveHandler/CustomerGroup.php
35+
index a49470c67065..850bb7f8a3f5 100644
36+
--- a/vendor/magento/module-company/Model/SaveHandler/CustomerGroup.php
37+
+++ b/vendor/magento/module-company/Model/SaveHandler/CustomerGroup.php
38+
@@ -39,7 +39,7 @@ public function __construct(
39+
}
40+
41+
/**
42+
- * {@inheritdoc}
43+
+ * @inheritdoc
44+
* @throws \Magento\Framework\Exception\InputException
45+
* @throws \Magento\Framework\Exception\LocalizedException
46+
* @throws \Magento\Framework\Exception\State\InputMismatchException
47+
@@ -52,6 +52,7 @@ public function execute(CompanyInterface $company, CompanyInterface $initialComp
48+
foreach ($customerIds as $customerId) {
49+
$customer = $this->customerRepository->getById($customerId);
50+
$customer->setGroupId($company->getCustomerGroupId());
51+
+ $customer->setData('ignore_validation_flag', true);
52+
$this->customerRepository->save($customer);
53+
}
54+
}
55+
diff --git a/vendor/magento/module-company/Model/SaveHandler/SuperUser.php b/vendor/magento/module-company/Model/SaveHandler/SuperUser.php
56+
index a510b3083b3b..74a9df1ef044 100644
57+
--- a/vendor/magento/module-company/Model/SaveHandler/SuperUser.php
58+
+++ b/vendor/magento/module-company/Model/SaveHandler/SuperUser.php
59+
@@ -65,6 +65,7 @@ public function execute(CompanyInterface $company, CompanyInterface $initialComp
60+
$admin->getExtensionAttributes()->setCompanyAttributes($companyAttributes);
61+
}
62+
$admin->getExtensionAttributes()->getCompanyAttributes()->setCompanyId($company->getId());
63+
+ $admin->setData('ignore_validation_flag', true);
64+
$this->customerRepository->save($admin);
65+
$initialAdmin = $initialCompany->getSuperUserId()
66+
? $this->customerRepository->getById($initialCompany->getSuperUserId()) : null;
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/vendor/magento/module-company/Block/Adminhtml/Customer/Edit/Tab/View/PersonalInfo.php b/vendor/magento/module-company/Block/Adminhtml/Customer/Edit/Tab/View/PersonalInfo.php
2+
index fe6ac9a1886e..3236510caf67 100644
3+
--- a/vendor/magento/module-company/Block/Adminhtml/Customer/Edit/Tab/View/PersonalInfo.php
4+
+++ b/vendor/magento/module-company/Block/Adminhtml/Customer/Edit/Tab/View/PersonalInfo.php
5+
@@ -103,8 +103,8 @@ public function getJobTitle()
6+
public function getCustomerType()
7+
{
8+
$customerType = CompanyCustomerInterface::TYPE_INDIVIDUAL_USER;
9+
- if ($this->getCustomerAttributes() && $this->getCustomerAttributes()->getCompanyId()) {
10+
- $company = $this->getCompany();
11+
+ $company = $this->getCompany();
12+
+ if ($company !== null) {
13+
$customer = $this->_backendSession->getCustomerData()['account'];
14+
$customerType = ($company->getSuperUserId() == $customer['id'])
15+
? CompanyCustomerInterface::TYPE_COMPANY_ADMIN
+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
diff --git a/vendor/magento/module-purchase-order/Plugin/Quote/ExpiredQuotesCollectionFilter.php b/vendor/magento/module-purchase-order/Plugin/Quote/ExpiredQuotesCollectionFilter.php
2+
new file mode 100644
3+
index 0000000000..54510ebe51
4+
--- /dev/null
5+
+++ b/vendor/magento/module-purchase-order/Plugin/Quote/ExpiredQuotesCollectionFilter.php
6+
@@ -0,0 +1,80 @@
7+
+<?php
8+
+/**
9+
+ * Copyright 2024 Adobe
10+
+ * All Rights Reserved.
11+
+ */
12+
+declare(strict_types=1);
13+
+
14+
+namespace Magento\PurchaseOrder\Plugin\Quote;
15+
+
16+
+use Magento\Framework\Exception\LocalizedException;
17+
+use Magento\Store\Api\Data\StoreInterface;
18+
+use Magento\Store\Api\WebsiteRepositoryInterface;
19+
+use Magento\PurchaseOrder\Model\Config;
20+
+use Magento\PurchaseOrder\Model\ResourceModel\PurchaseOrder as PurchaseOrderResource;
21+
+use Magento\Sales\Model\ResourceModel\Collection\ExpiredQuotesCollection;
22+
+use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
23+
+
24+
+/**
25+
+ * Plugin to filter out quotes used in purchase orders to prevent from deletion
26+
+ */
27+
+class ExpiredQuotesCollectionFilter
28+
+{
29+
+ /**
30+
+ * @var PurchaseOrderResource
31+
+ */
32+
+ private $purchaseOrderResource;
33+
+
34+
+ /**
35+
+ * @var Config
36+
+ */
37+
+ private $config;
38+
+
39+
+ /**
40+
+ * @var WebsiteRepositoryInterface
41+
+ */
42+
+ private $websiteRepository;
43+
+
44+
+ /**
45+
+ * @param PurchaseOrderResource $purchaseOrderResource
46+
+ * @param Config $config
47+
+ * @param WebsiteRepositoryInterface $websiteRepository
48+
+ */
49+
+ public function __construct(
50+
+ PurchaseOrderResource $purchaseOrderResource,
51+
+ Config $config,
52+
+ WebsiteRepositoryInterface $websiteRepository
53+
+ ) {
54+
+ $this->purchaseOrderResource = $purchaseOrderResource;
55+
+ $this->config = $config;
56+
+ $this->websiteRepository = $websiteRepository;
57+
+ }
58+
+
59+
+ /**
60+
+ * Add filter to the expired quotes collection
61+
+ *
62+
+ * @param ExpiredQuotesCollection $subject
63+
+ * @param AbstractCollection $result
64+
+ * @param StoreInterface $store
65+
+ * @return AbstractCollection
66+
+ * @throws LocalizedException
67+
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
68+
+ */
69+
+ public function afterGetExpiredQuotes(
70+
+ ExpiredQuotesCollection $subject,
71+
+ AbstractCollection $result,
72+
+ StoreInterface $store
73+
+ ): AbstractCollection {
74+
+ $website = $this->websiteRepository->getById($store->getWebsiteId());
75+
+ if ($this->config->isEnabledForWebsite($website)) {
76+
+ $result->getSelect()->joinLeft(
77+
+ ['po' => $this->purchaseOrderResource->getTable($this->purchaseOrderResource->getMainTable())],
78+
+ 'po.quote_id = main_table.entity_id',
79+
+ 'po.quote_id'
80+
+ );
81+
+ $result->addFieldToFilter('po.entity_id', ['null' => true]);
82+
+ }
83+
+
84+
+ return $result;
85+
+ }
86+
+}
87+
diff --git a/vendor/magento/module-purchase-order/etc/di.xml b/vendor/magento/module-purchase-order/etc/di.xml
88+
index acdc58579d..893e294d7b 100644
89+
--- a/vendor/magento/module-purchase-order/etc/di.xml
90+
+++ b/vendor/magento/module-purchase-order/etc/di.xml
91+
@@ -316,4 +316,7 @@
92+
<type name="Magento\AsyncOrder\Model\AsyncPaymentInformationCustomerPublisher">
93+
<plugin name="company_user_po_permission_plugin" type="Magento\PurchaseOrder\Plugin\AsyncOrder\Model\PermissionCheckPlugin"/>
94+
</type>
95+
+ <type name="Magento\Sales\Model\ResourceModel\Collection\ExpiredQuotesCollection">
96+
+ <plugin name="expiredQuotesCollectionFilter" type="Magento\PurchaseOrder\Plugin\Quote\ExpiredQuotesCollectionFilter"/>
97+
+ </type>
98+
</config>
+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
diff --git a/vendor/magento/module-company-graph-ql/Model/Company/Users/Formatter.php b/vendor/magento/module-company-graph-ql/Model/Company/Users/Formatter.php
2+
index d24f6d6cbe..0091d6d69b 100644
3+
--- a/vendor/magento/module-company-graph-ql/Model/Company/Users/Formatter.php
4+
+++ b/vendor/magento/module-company-graph-ql/Model/Company/Users/Formatter.php
5+
@@ -9,6 +9,7 @@ declare(strict_types=1);
6+
namespace Magento\CompanyGraphQl\Model\Company\Users;
7+
8+
use Magento\Company\Api\Data\TeamInterface;
9+
+use Magento\Company\Api\RoleManagementInterface;
10+
use Magento\Company\Api\RoleRepositoryInterface;
11+
use Magento\Company\Model\Company\Structure;
12+
use Magento\Company\Model\UserRoleManagement;
13+
@@ -49,6 +50,11 @@ class Formatter
14+
*/
15+
private $roleRepository;
16+
17+
+ /**
18+
+ * @var RoleManagementInterface
19+
+ */
20+
+ private $roleManagement;
21+
+
22+
/**
23+
* @var Uid
24+
*/
25+
@@ -60,6 +66,7 @@ class Formatter
26+
* @param Structure $structure
27+
* @param PermissionsFormatter $permissionsFormatter
28+
* @param RoleRepositoryInterface $roleRepository
29+
+ * @param RoleManagementInterface $roleManagement
30+
* @param Uid $idEncoder
31+
*/
32+
public function __construct(
33+
@@ -68,6 +75,7 @@ class Formatter
34+
Structure $structure,
35+
PermissionsFormatter $permissionsFormatter,
36+
RoleRepositoryInterface $roleRepository,
37+
+ RoleManagementInterface $roleManagement,
38+
Uid $idEncoder
39+
) {
40+
$this->customerData = $customerData;
41+
@@ -75,6 +83,7 @@ class Formatter
42+
$this->permissionsFormatter = $permissionsFormatter;
43+
$this->structure = $structure;
44+
$this->roleRepository = $roleRepository;
45+
+ $this->roleManagement = $roleManagement;
46+
$this->idEncoder = $idEncoder;
47+
}
48+
49+
@@ -108,7 +117,7 @@ class Formatter
50+
* Format user's role according to the GraphQL schema
51+
*
52+
* @param int $userId
53+
- * @return array
54+
+ * @return array|null
55+
*/
56+
public function formatRole(int $userId): ?array
57+
{
58+
@@ -118,13 +127,18 @@ class Formatter
59+
}
60+
61+
$role = current($roles);
62+
+ $userCount = 1;
63+
64+
try {
65+
- $role = $this->roleRepository->get($role->getId());
66+
+ if ($this->roleManagement->getCompanyAdminRoleId() !== $role->getId()) {
67+
+ $role = $this->roleRepository->get($role->getId());
68+
+ $userCount = count($this->userRoleManagement->getUsersByRoleId($role->getId()));
69+
+ }
70+
+
71+
return [
72+
'id' => $this->idEncoder->encode((string)$role->getId()),
73+
'name' => $role->getRoleName(),
74+
- 'users_count' => count($this->userRoleManagement->getUsersByRoleId($role->getId())),
75+
+ 'users_count' => $userCount,
76+
'permissions' => $this->permissionsFormatter->format($role)
77+
];
78+
} catch (\Exception $e) {
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/vendor/magento/module-multicoupon/Model/CouponManagement.php b/vendor/magento/module-multicoupon/Model/CouponManagement.php
2+
index 7f37d005afa..d9162e2a65f 100644
3+
--- a/vendor/magento/module-multicoupon/Model/CouponManagement.php
4+
+++ b/vendor/magento/module-multicoupon/Model/CouponManagement.php
5+
@@ -151,8 +151,8 @@ class CouponManagement implements CouponManagementInterface
6+
}
7+
8+
$invalidCouponCodes = array_diff(
9+
- $couponCodes,
10+
- array_values($this->validateCouponCode->execute($couponCodes, $customerId))
11+
+ array_map('strtolower', $couponCodes),
12+
+ array_map('strtolower', array_values($this->validateCouponCode->execute($couponCodes, $customerId)))
13+
);
14+
15+
if (!empty($invalidCouponCodes)) {
16+
diff --git a/vendor/magento/module-multicoupon-ui/Plugin/AdminCreateOrderApplyCoupons.php b/vendor/magento/module-multicoupon-ui/Plugin/AdminCreateOrderApplyCoupons.php
17+
index dfe3eda9d4e..dfe583bcd0a 100644
18+
--- a/vendor/magento/module-multicoupon-ui/Plugin/AdminCreateOrderApplyCoupons.php
19+
+++ b/vendor/magento/module-multicoupon-ui/Plugin/AdminCreateOrderApplyCoupons.php
20+
@@ -163,8 +163,8 @@ class AdminCreateOrderApplyCoupons
21+
}
22+
23+
$invalidCouponCodes = array_diff(
24+
- [$appendCouponCode],
25+
- array_values($this->validateCouponCode->execute([$appendCouponCode], $customerId))
26+
+ [strtolower($appendCouponCode)],
27+
+ array_map('strtolower', array_values($this->validateCouponCode->execute([$appendCouponCode], $customerId)))
28+
);
29+
if (!empty($invalidCouponCodes)) {
30+
return false;
31+
diff --git a/vendor/magento/module-multicoupon-ui/Plugin/AdminCreateOrderValidateCoupon.php b/vendor/magento/module-multicoupon-ui/Plugin/AdminCreateOrderValidateCoupon.php
32+
index 9aaceb9179d..d5f2e29febf 100644
33+
--- a/vendor/magento/module-multicoupon-ui/Plugin/AdminCreateOrderValidateCoupon.php
34+
+++ b/vendor/magento/module-multicoupon-ui/Plugin/AdminCreateOrderValidateCoupon.php
35+
@@ -73,13 +73,13 @@ class AdminCreateOrderValidateCoupon
36+
return;
37+
}
38+
39+
- if (in_array($code, $quote->getExtensionAttributes()->getCouponCodes())) {
40+
+ if (in_array(strtolower($code), array_map('strtolower', $quote->getExtensionAttributes()->getCouponCodes()))) {
41+
$this->messageManager->addSuccessMessage(__('The coupon code has been accepted.'));
42+
return;
43+
}
44+
45+
if (count($quote->getExtensionAttributes()->getCouponCodes())
46+
- >= $this->config->getMaximumNumberOfCoupons()
47+
+ > $this->config->getMaximumNumberOfCoupons()
48+
) {
49+
$this->messageManager->addErrorMessage(
50+
__('Maximum allowed number of applied coupons was exceeded.')

patches/os/ACSD-48318_2.4.4.patch

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
diff --git a/vendor/magento/module-sales/Model/Order/Email/Sender/CreditmemoSender.php b/vendor/magento/module-sales/Model/Order/Email/Sender/CreditmemoSender.php
2+
index 19dc62772513..22d5bc2b7a56 100644
3+
--- a/vendor/magento/module-sales/Model/Order/Email/Sender/CreditmemoSender.php
4+
+++ b/vendor/magento/module-sales/Model/Order/Email/Sender/CreditmemoSender.php
5+
@@ -118,6 +118,7 @@ public function send(Creditmemo $creditmemo, $forceSyncMode = false)
6+
7+
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
8+
$order = $creditmemo->getOrder();
9+
+ $paymentHTML = $this->getPaymentHtml($order);
10+
$this->appEmulation->startEnvironmentEmulation($order->getStoreId(), Area::AREA_FRONTEND, true);
11+
$transport = [
12+
'order' => $order,
13+
@@ -126,7 +127,7 @@ public function send(Creditmemo $creditmemo, $forceSyncMode = false)
14+
'creditmemo_id' => $creditmemo->getId(),
15+
'comment' => $creditmemo->getCustomerNoteNotify() ? $creditmemo->getCustomerNote() : '',
16+
'billing' => $order->getBillingAddress(),
17+
- 'payment_html' => $this->getPaymentHtml($order),
18+
+ 'payment_html' => $paymentHTML,
19+
'store' => $order->getStore(),
20+
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
21+
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
22+
diff --git a/vendor/magento/module-sales/Model/Order/Email/Sender/InvoiceSender.php b/vendor/magento/module-sales/Model/Order/Email/Sender/InvoiceSender.php
23+
index d94e02816e26..d8afe6beba5e 100644
24+
--- a/vendor/magento/module-sales/Model/Order/Email/Sender/InvoiceSender.php
25+
+++ b/vendor/magento/module-sales/Model/Order/Email/Sender/InvoiceSender.php
26+
@@ -125,6 +125,7 @@ public function send(Invoice $invoice, $forceSyncMode = false)
27+
$order->setBaseTaxAmount((float) $invoice->getBaseTaxAmount());
28+
$order->setBaseShippingAmount((float) $invoice->getBaseShippingAmount());
29+
}
30+
+ $paymentHTML = $this->getPaymentHtml($order);
31+
$this->appEmulation->startEnvironmentEmulation($order->getStoreId(), Area::AREA_FRONTEND, true);
32+
$transport = [
33+
'order' => $order,
34+
@@ -133,7 +134,7 @@ public function send(Invoice $invoice, $forceSyncMode = false)
35+
'invoice_id' => $invoice->getId(),
36+
'comment' => $invoice->getCustomerNoteNotify() ? $invoice->getCustomerNote() : '',
37+
'billing' => $order->getBillingAddress(),
38+
- 'payment_html' => $this->getPaymentHtml($order),
39+
+ 'payment_html' => $paymentHTML,
40+
'store' => $order->getStore(),
41+
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
42+
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
43+
diff --git a/vendor/magento/module-sales/Model/Order/Email/Sender/ShipmentSender.php b/vendor/magento/module-sales/Model/Order/Email/Sender/ShipmentSender.php
44+
index ba6d65a40c65..78aaf1a696e9 100644
45+
--- a/vendor/magento/module-sales/Model/Order/Email/Sender/ShipmentSender.php
46+
+++ b/vendor/magento/module-sales/Model/Order/Email/Sender/ShipmentSender.php
47+
@@ -120,6 +120,7 @@ public function send(Shipment $shipment, $forceSyncMode = false)
48+
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
49+
$order = $shipment->getOrder();
50+
$this->identityContainer->setStore($order->getStore());
51+
+ $paymentHTML = $this->getPaymentHtml($order);
52+
$this->appEmulation->startEnvironmentEmulation($order->getStoreId(), Area::AREA_FRONTEND, true);
53+
$transport = [
54+
'order' => $order,
55+
@@ -128,7 +129,7 @@ public function send(Shipment $shipment, $forceSyncMode = false)
56+
'shipment_id' => $shipment->getId(),
57+
'comment' => $shipment->getCustomerNoteNotify() ? $shipment->getCustomerNote() : '',
58+
'billing' => $order->getBillingAddress(),
59+
- 'payment_html' => $this->getPaymentHtml($order),
60+
+ 'payment_html' => $paymentHTML,
61+
'store' => $order->getStore(),
62+
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
63+
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),

0 commit comments

Comments
 (0)