Skip to content

Commit

Permalink
1.1.40 release (#145)
Browse files Browse the repository at this point in the history
* 1.1.40 Release
  • Loading branch information
agorbivskyi authored Oct 24, 2023
1 parent 521a136 commit 604135b
Show file tree
Hide file tree
Showing 25 changed files with 2,677 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/quality-patches",
"description": "Provides quality patches for AdobeCommerce & Magento OpenSource",
"type": "magento2-component",
"version": "1.1.39",
"version": "1.1.40",
"license": "proprietary",
"repositories": {
"repo": {
Expand Down
2 changes: 1 addition & 1 deletion patches-info.json

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions patches/commerce/ACSD-53378_1.3.4-p3.patch
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;
}
}
79 changes: 79 additions & 0 deletions patches/commerce/ACSD-53378_2.4.5-p3.patch
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>
14 changes: 14 additions & 0 deletions patches/commerce/ACSD-53414_2.4.6-p1.patch
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);
13 changes: 13 additions & 0 deletions patches/commerce/ACSD-54040_1.3.4-p4.patch
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;
}
}
Loading

0 comments on commit 604135b

Please sign in to comment.