-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
25 changed files
with
2,677 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
diff --git a/vendor/magento/module-company/Model/CompanyContext.php b/vendor/magento/module-company/Model/CompanyContext.php | ||
index 6702e91d2483..e94ac986cf40 100644 | ||
--- a/vendor/magento/module-company/Model/CompanyContext.php | ||
+++ b/vendor/magento/module-company/Model/CompanyContext.php | ||
@@ -6,6 +6,8 @@ | ||
|
||
namespace Magento\Company\Model; | ||
|
||
+use Magento\Customer\Model\CustomerRegistry; | ||
+use Magento\Framework\App\ObjectManager; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
|
||
/** | ||
@@ -51,6 +53,11 @@ class CompanyContext | ||
*/ | ||
private $httpContext; | ||
|
||
+ /** | ||
+ * @var CustomerRegistry | ||
+ */ | ||
+ private CustomerRegistry $customerRegistry; | ||
+ | ||
/** | ||
* CompanyContext constructor. | ||
* | ||
@@ -60,6 +67,7 @@ class CompanyContext | ||
* @param \Magento\Company\Model\CompanyUserPermission $companyUserPermission | ||
* @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository | ||
* @param \Magento\Framework\App\Http\Context $httpContext | ||
+ * @param CustomerRegistry $customerRegistry | ||
*/ | ||
public function __construct( | ||
\Magento\Company\Api\StatusServiceInterface $moduleConfig, | ||
@@ -67,7 +75,8 @@ public function __construct( | ||
\Magento\Company\Api\AuthorizationInterface $authorization, | ||
\Magento\Company\Model\CompanyUserPermission $companyUserPermission, | ||
\Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, | ||
- \Magento\Framework\App\Http\Context $httpContext | ||
+ \Magento\Framework\App\Http\Context $httpContext, | ||
+ CustomerRegistry $customerRegistry = null | ||
) { | ||
$this->moduleConfig = $moduleConfig; | ||
$this->userContext = $userContext; | ||
@@ -75,6 +84,8 @@ public function __construct( | ||
$this->companyUserPermission = $companyUserPermission; | ||
$this->customerRepository = $customerRepository; | ||
$this->httpContext = $httpContext; | ||
+ $this->customerRegistry = $customerRegistry ?: ObjectManager::getInstance() | ||
+ ->get(CustomerRegistry::class); | ||
} | ||
|
||
/** | ||
@@ -144,7 +155,6 @@ public function isCurrentUserCompanyUser() | ||
* Retrieves customer group of the user. | ||
* | ||
* @return int | ||
- * @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function getCustomerGroupId() | ||
{ | ||
@@ -152,7 +162,7 @@ public function getCustomerGroupId() | ||
$customerId = $this->getCustomerId(); | ||
if ($customerId) { | ||
try { | ||
- $customer = $this->customerRepository->getById($customerId); | ||
+ $customer = $this->customerRegistry->retrieve($customerId); | ||
$this->customerGroupId = $customer->getGroupId(); | ||
} catch (NoSuchEntityException $e) { | ||
} | ||
diff --git a/vendor/magento/module-shared-catalog/Plugin/Customer/Model/SessionPlugin.php b/vendor/magento/module-shared-catalog/Plugin/Customer/Model/SessionPlugin.php | ||
index 698b76978c80..749cdcd34701 100644 | ||
--- a/vendor/magento/module-shared-catalog/Plugin/Customer/Model/SessionPlugin.php | ||
+++ b/vendor/magento/module-shared-catalog/Plugin/Customer/Model/SessionPlugin.php | ||
@@ -23,16 +23,17 @@ class SessionPlugin | ||
public function afterGetCustomerGroupId(Session $subject, $groupId) | ||
{ | ||
try { | ||
- if ($subject->getCustomerData()) { | ||
- if ($groupId != $subject->getCustomerData()->getGroupId()) { | ||
- $customerGroupId = $subject->getCustomerData()->getGroupId(); | ||
- $subject->setCustomerGroupId($customerGroupId); | ||
- return $customerGroupId; | ||
- } | ||
+ $customer = $subject->getCustomer(); | ||
+ if ($customer->getGroupId() && ($groupId != $customer->getGroupId())) { | ||
+ $customerGroupId = $customer->getGroupId(); | ||
+ $subject->setCustomerGroupId($customerGroupId); | ||
+ | ||
+ return $customerGroupId; | ||
} | ||
- return $groupId; | ||
- } catch (NoSuchEntityException $e) { | ||
+ } catch (NoSuchEntityException $exception) { | ||
return $groupId; | ||
} | ||
+ | ||
+ return $groupId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
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 | ||
new file mode 100644 | ||
index 000000000000..eb9c31c32a08 | ||
--- /dev/null | ||
+++ b/vendor/magento/module-checkout-address-search/Plugin/Customer/Model/Address/CustomerAddressDataProvider.php | ||
@@ -0,0 +1,61 @@ | ||
+<?php | ||
+/** | ||
+ * Copyright 2023 Adobe | ||
+ * All Rights Reserved. | ||
+ * | ||
+ * ADOBE CONFIDENTIAL | ||
+ * | ||
+ * NOTICE: All information contained herein is, and remains | ||
+ * the property of Adobe and its suppliers, if any. The intellectual | ||
+ * and technical concepts contained herein are proprietary to Adobe | ||
+ * and its suppliers and are protected by all applicable intellectual | ||
+ * property laws, including trade secret and copyright laws. | ||
+ * Dissemination of this information or reproduction of this material | ||
+ * is strictly forbidden unless prior written permission is obtained | ||
+ * from Adobe. | ||
+ */ | ||
+ | ||
+declare(strict_types=1); | ||
+ | ||
+namespace Magento\CheckoutAddressSearch\Plugin\Customer\Model\Address; | ||
+ | ||
+use Magento\Customer\Model\Address\CustomerAddressDataProvider as AddressDataProvider; | ||
+use Magento\Customer\Api\Data\CustomerInterface; | ||
+use Magento\CheckoutAddressSearch\Model\Config as CustomerAddressSearchConfig; | ||
+ | ||
+class CustomerAddressDataProvider | ||
+{ | ||
+ /** | ||
+ * @var CustomerAddressSearchConfig | ||
+ */ | ||
+ private CustomerAddressSearchConfig $config; | ||
+ | ||
+ /** | ||
+ * @param CustomerAddressSearchConfig $config | ||
+ */ | ||
+ public function __construct(CustomerAddressSearchConfig $config) | ||
+ { | ||
+ $this->config = $config; | ||
+ } | ||
+ | ||
+ /** | ||
+ * If address search is enabled we should limit the number of addresses required | ||
+ * | ||
+ * @param AddressDataProvider $subject | ||
+ * @param CustomerInterface $customer | ||
+ * @param int|null $addressLimit | ||
+ * @return array | ||
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
+ */ | ||
+ public function beforeGetAddressDataByCustomer( | ||
+ AddressDataProvider $subject, | ||
+ CustomerInterface $customer, | ||
+ ?int $addressLimit = null | ||
+ ): array { | ||
+ if ($this->config->isEnabledAddressSearch()) { | ||
+ $addressLimit = $this->config->getSearchLimit(); | ||
+ } | ||
+ | ||
+ return [$customer, $addressLimit]; | ||
+ } | ||
+} | ||
diff --git a/vendor/magento/module-checkout-address-search/etc/frontend/di.xml b/vendor/magento/module-checkout-address-search/etc/frontend/di.xml | ||
index 0632a7808a33..bb5a52526556 100644 | ||
--- a/vendor/magento/module-checkout-address-search/etc/frontend/di.xml | ||
+++ b/vendor/magento/module-checkout-address-search/etc/frontend/di.xml | ||
@@ -14,4 +14,7 @@ | ||
</argument> | ||
</arguments> | ||
</type> | ||
+ <type name="Magento\Customer\Model\Address\CustomerAddressDataProvider"> | ||
+ <plugin name="customer_address_provider" type="Magento\CheckoutAddressSearch\Plugin\Customer\Model\Address\CustomerAddressDataProvider" sortOrder="1" disabled="false" /> | ||
+ </type> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff --git a/vendor/magento/module-admin-gws/Plugin/CollectionFilter.php b/vendor/magento/module-admin-gws/Plugin/CollectionFilter.php | ||
index 6390bc8a00c..7677ea811d1 100755 | ||
--- a/vendor/magento/module-admin-gws/Plugin/CollectionFilter.php | ||
+++ b/vendor/magento/module-admin-gws/Plugin/CollectionFilter.php | ||
@@ -100,6 +100,9 @@ class CollectionFilter | ||
if (method_exists($collection, 'addStoresFilter')) { | ||
$collection->addStoresFilter($this->getStoreIds()); | ||
$collection->setFlag(self::FILTERED_FLAG_NAME, true); | ||
+ } elseif (method_exists($collection, 'addStoreFilter')) { | ||
+ $collection->addStoreFilter($this->getStoreIds()); | ||
+ $collection->setFlag(self::FILTERED_FLAG_NAME, true); | ||
} elseif (isset($collection->getSelect()->getPart(Select::FROM)['main_table'])) { | ||
$this->tableBasedFilter($collection); | ||
$collection->setFlag(self::FILTERED_FLAG_NAME, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/vendor/magento/module-negotiable-quote/Plugin/Sales/Block/Order/Info/CreationInfoPlugin.php b/vendor/magento/module-negotiable-quote/Plugin/Sales/Block/Order/Info/CreationInfoPlugin.php | ||
index d68b3164e030..5e997fcb3d80 100644 | ||
--- a/vendor/magento/module-negotiable-quote/Plugin/Sales/Block/Order/Info/CreationInfoPlugin.php | ||
+++ b/vendor/magento/module-negotiable-quote/Plugin/Sales/Block/Order/Info/CreationInfoPlugin.php | ||
@@ -73,7 +73,7 @@ public function afterGetCreationInfo(CreationInfo $subject, string $result): str | ||
if ($orderId) { | ||
$order = $this->orderRepository->get($orderId); | ||
|
||
- if ($order && $order->getEntityId() && $order->getCustomerId() === $customerId) { | ||
+ if ($order && $order->getEntityId() && (int)$order->getCustomerId() === $customerId) { | ||
return $result; | ||
} | ||
} |
Oops, something went wrong.