Skip to content

Commit 2796872

Browse files
Merge pull request #152 from magento-commerce/1.1.47-release
1.1.47 Release
2 parents 1caa9b7 + 1ddab32 commit 2796872

12 files changed

+1420
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
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.46",
5+
"version": "1.1.47",
66
"license": "proprietary",
77
"repositories": {
88
"repo": {

patches-info.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
diff --git a/vendor/magento/module-company/Model/CompanyContext.php b/vendor/magento/module-company/Model/CompanyContext.php
2+
index 6702e91d2483..e94ac986cf40 100644
3+
--- a/vendor/magento/module-company/Model/CompanyContext.php
4+
+++ b/vendor/magento/module-company/Model/CompanyContext.php
5+
@@ -6,6 +6,8 @@
6+
7+
namespace Magento\Company\Model;
8+
9+
+use Magento\Customer\Model\CustomerRegistry;
10+
+use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\Exception\NoSuchEntityException;
12+
13+
/**
14+
@@ -51,6 +53,11 @@ class CompanyContext
15+
*/
16+
private $httpContext;
17+
18+
+ /**
19+
+ * @var CustomerRegistry
20+
+ */
21+
+ private CustomerRegistry $customerRegistry;
22+
+
23+
/**
24+
* CompanyContext constructor.
25+
*
26+
@@ -60,6 +67,7 @@ class CompanyContext
27+
* @param \Magento\Company\Model\CompanyUserPermission $companyUserPermission
28+
* @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
29+
* @param \Magento\Framework\App\Http\Context $httpContext
30+
+ * @param CustomerRegistry $customerRegistry
31+
*/
32+
public function __construct(
33+
\Magento\Company\Api\StatusServiceInterface $moduleConfig,
34+
@@ -67,7 +75,8 @@ public function __construct(
35+
\Magento\Company\Api\AuthorizationInterface $authorization,
36+
\Magento\Company\Model\CompanyUserPermission $companyUserPermission,
37+
\Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
38+
- \Magento\Framework\App\Http\Context $httpContext
39+
+ \Magento\Framework\App\Http\Context $httpContext,
40+
+ CustomerRegistry $customerRegistry = null
41+
) {
42+
$this->moduleConfig = $moduleConfig;
43+
$this->userContext = $userContext;
44+
@@ -75,6 +84,8 @@ public function __construct(
45+
$this->companyUserPermission = $companyUserPermission;
46+
$this->customerRepository = $customerRepository;
47+
$this->httpContext = $httpContext;
48+
+ $this->customerRegistry = $customerRegistry ?: ObjectManager::getInstance()
49+
+ ->get(CustomerRegistry::class);
50+
}
51+
52+
/**
53+
@@ -144,7 +155,6 @@ public function isCurrentUserCompanyUser()
54+
* Retrieves customer group of the user.
55+
*
56+
* @return int
57+
- * @throws \Magento\Framework\Exception\LocalizedException
58+
*/
59+
public function getCustomerGroupId()
60+
{
61+
@@ -152,7 +162,7 @@ public function getCustomerGroupId()
62+
$customerId = $this->getCustomerId();
63+
if ($customerId) {
64+
try {
65+
- $customer = $this->customerRepository->getById($customerId);
66+
+ $customer = $this->customerRegistry->retrieve($customerId);
67+
$this->customerGroupId = $customer->getGroupId();
68+
} catch (NoSuchEntityException $e) {
69+
}
70+
diff --git a/vendor/magento/module-shared-catalog/Plugin/Customer/Model/SessionPlugin.php b/vendor/magento/module-shared-catalog/Plugin/Customer/Model/SessionPlugin.php
71+
index 698b76978c80..749cdcd34701 100644
72+
--- a/vendor/magento/module-shared-catalog/Plugin/Customer/Model/SessionPlugin.php
73+
+++ b/vendor/magento/module-shared-catalog/Plugin/Customer/Model/SessionPlugin.php
74+
@@ -23,16 +23,17 @@ class SessionPlugin
75+
public function afterGetCustomerGroupId(Session $subject, $groupId)
76+
{
77+
try {
78+
- if ($subject->getCustomerData()) {
79+
- if ($groupId != $subject->getCustomerData()->getGroupId()) {
80+
- $customerGroupId = $subject->getCustomerData()->getGroupId();
81+
- $subject->setCustomerGroupId($customerGroupId);
82+
- return $customerGroupId;
83+
- }
84+
+ $customer = $subject->getCustomer();
85+
+ if ($customer->getGroupId() && ($groupId != $customer->getGroupId())) {
86+
+ $customerGroupId = $customer->getGroupId();
87+
+ $subject->setCustomerGroupId($customerGroupId);
88+
+
89+
+ return $customerGroupId;
90+
}
91+
- return $groupId;
92+
- } catch (NoSuchEntityException $e) {
93+
+ } catch (NoSuchEntityException $exception) {
94+
return $groupId;
95+
}
96+
+
97+
+ return $groupId;
98+
}
99+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
diff --git a/vendor/magento/module-checkout-address-search/Plugin/Customer/Model/Address/CustomerAddressDataProvider.php b/vendor/magento/module-checkout-address-search/Plugin/Customer/Model/Address/CustomerAddressDataProvider.php
2+
new file mode 100644
3+
index 000000000000..eb9c31c32a08
4+
--- /dev/null
5+
+++ b/vendor/magento/module-checkout-address-search/Plugin/Customer/Model/Address/CustomerAddressDataProvider.php
6+
@@ -0,0 +1,61 @@
7+
+<?php
8+
+/**
9+
+ * Copyright 2023 Adobe
10+
+ * All Rights Reserved.
11+
+ *
12+
+ * ADOBE CONFIDENTIAL
13+
+ *
14+
+ * NOTICE: All information contained herein is, and remains
15+
+ * the property of Adobe and its suppliers, if any. The intellectual
16+
+ * and technical concepts contained herein are proprietary to Adobe
17+
+ * and its suppliers and are protected by all applicable intellectual
18+
+ * property laws, including trade secret and copyright laws.
19+
+ * Dissemination of this information or reproduction of this material
20+
+ * is strictly forbidden unless prior written permission is obtained
21+
+ * from Adobe.
22+
+ */
23+
+
24+
+declare(strict_types=1);
25+
+
26+
+namespace Magento\CheckoutAddressSearch\Plugin\Customer\Model\Address;
27+
+
28+
+use Magento\Customer\Model\Address\CustomerAddressDataProvider as AddressDataProvider;
29+
+use Magento\Customer\Api\Data\CustomerInterface;
30+
+use Magento\CheckoutAddressSearch\Model\Config as CustomerAddressSearchConfig;
31+
+
32+
+class CustomerAddressDataProvider
33+
+{
34+
+ /**
35+
+ * @var CustomerAddressSearchConfig
36+
+ */
37+
+ private CustomerAddressSearchConfig $config;
38+
+
39+
+ /**
40+
+ * @param CustomerAddressSearchConfig $config
41+
+ */
42+
+ public function __construct(CustomerAddressSearchConfig $config)
43+
+ {
44+
+ $this->config = $config;
45+
+ }
46+
+
47+
+ /**
48+
+ * If address search is enabled we should limit the number of addresses required
49+
+ *
50+
+ * @param AddressDataProvider $subject
51+
+ * @param CustomerInterface $customer
52+
+ * @param int|null $addressLimit
53+
+ * @return array
54+
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
55+
+ */
56+
+ public function beforeGetAddressDataByCustomer(
57+
+ AddressDataProvider $subject,
58+
+ CustomerInterface $customer,
59+
+ ?int $addressLimit = null
60+
+ ): array {
61+
+ if ($this->config->isEnabledAddressSearch()) {
62+
+ $addressLimit = $this->config->getSearchLimit();
63+
+ }
64+
+
65+
+ return [$customer, $addressLimit];
66+
+ }
67+
+}
68+
diff --git a/vendor/magento/module-checkout-address-search/etc/frontend/di.xml b/vendor/magento/module-checkout-address-search/etc/frontend/di.xml
69+
index 0632a7808a33..bb5a52526556 100644
70+
--- a/vendor/magento/module-checkout-address-search/etc/frontend/di.xml
71+
+++ b/vendor/magento/module-checkout-address-search/etc/frontend/di.xml
72+
@@ -14,4 +14,7 @@
73+
</argument>
74+
</arguments>
75+
</type>
76+
+ <type name="Magento\Customer\Model\Address\CustomerAddressDataProvider">
77+
+ <plugin name="customer_address_provider" type="Magento\CheckoutAddressSearch\Plugin\Customer\Model\Address\CustomerAddressDataProvider" sortOrder="1" disabled="false" />
78+
+ </type>
79+
</config>

0 commit comments

Comments
 (0)