Skip to content

Commit 9769eec

Browse files
Merge branch 'develop' into MCLOUD-11623
2 parents 459a31d + fb7022e commit 9769eec

20 files changed

+1324
-39
lines changed

composer.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
"name": "magento/magento-cloud-patches",
33
"description": "Provides critical fixes for Magento 2 Enterprise Edition",
44
"type": "magento2-component",
5-
"version": "1.0.25",
5+
"version": "1.1.2",
66
"license": "OSL-3.0",
77
"repositories": {
88
"repo.magento.com": {
9-
"type": "composer",
10-
"url": "https://repo.magento.com/"
9+
"type": "composer",
10+
"url": "https://repo.magento.com/"
1111
}
1212
},
1313
"require": {
14-
"php": "^7.2 || ^8.0",
14+
"php": "^8.0",
1515
"ext-json": "*",
16-
"composer/composer": "^1.4 || ^2.0",
16+
"composer/composer": "^1.9 || ^2.0",
1717
"composer/semver": "@stable",
18+
"monolog/monolog": "^1.25||^2.3||^2.7|| ^3.6",
1819
"symfony/config": "^3.3||^4.4||^5.0||^6.0",
19-
"symfony/console": "^2.6||^4.0||^5.0||^6.0",
20+
"symfony/console": "^2.8 || ^4.0 || ^5.1 || ^5.4 || ^6.4",
2021
"symfony/dependency-injection": "^3.3||^4.3||^5.0||^6.0",
21-
"symfony/process": "^2.1||^4.1||^5.0||^6.0",
22+
"symfony/process": "^2.1 || ^4.1 || ^5.1 || ^5.4 || ^6.4",
2223
"symfony/proxy-manager-bridge": "^3.3||^4.3||^5.0||^6.0",
23-
"symfony/yaml": "^3.3||^4.0||^5.0||^6.0",
24-
"monolog/monolog": "^1.25||^2.3",
24+
"symfony/yaml": "^3.3||^4.0||^5.0||^6.0||^7.0",
2525
"magento/quality-patches": "^1.1.0"
2626
},
2727
"require-dev": {
28-
"codeception/codeception": "^4.1",
29-
"codeception/module-asserts": "^1.2",
30-
"codeception/module-db": "^1.0",
31-
"codeception/module-phpbrowser": "^1.0",
32-
"codeception/module-rest": "^1.2",
33-
"consolidation/robo": "^1.2 || ^2.0",
28+
"codeception/codeception": "^4.1 || ^5.1",
29+
"codeception/module-asserts": "^1.2 || ^3.0",
30+
"codeception/module-db": "^1.0 || ^3.0",
31+
"codeception/module-phpbrowser": "^1.0 || ^3.0",
32+
"codeception/module-rest": "^1.2 || ^3.0",
33+
"consolidation/robo": "^1.2 || ^3.0 || ^5.0",
3434
"phpmd/phpmd": "@stable",
3535
"phpunit/phpunit": "^8.5 || ^9.5",
3636
"squizlabs/php_codesniffer": "^3.0"

patches.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,18 @@
280280
},
281281
"Enhanced Layout Cache Efficiency (memory usage reduced)": {
282282
">=2.4.4 <2.4.7": "MCLOUD-11514__enhanced_layout_cache_efficiency__2.4.6-p3.patch"
283+
},
284+
"Patch for CVE-2024-34102 - CosmicSting": {
285+
">=2.4.4 <2.4.4-p8": "MCLOUD-12969__Patch_for_CVE_2024_34102_CosmicSting__2.4.4.patch",
286+
">=2.4.5 <2.4.5-p7": "MCLOUD-12969__Patch_for_CVE_2024_34102_CosmicSting__2.4.5.patch",
287+
">=2.4.6 <2.4.6-p5": "MCLOUD-12969__Patch_for_CVE_2024_34102_CosmicSting__2.4.6.patch",
288+
"2.4.7": "MCLOUD-12969__Patch_for_CVE_2024_34102_CosmicSting__2.4.7.patch"
289+
},
290+
"Patch for CVE-2024-34102 - KeyRotation": {
291+
">=2.4.4 <2.4.4-p10": "MCLOUD-12969__Patch_for_CVE_2024_34102_KeyRotation__2.4.4.patch",
292+
">=2.4.5 <2.4.5-p9": "MCLOUD-12969__Patch_for_CVE_2024_34102_KeyRotation__2.4.5.patch",
293+
">=2.4.6 <2.4.6-p7": "MCLOUD-12969__Patch_for_CVE_2024_34102_KeyRotation__2.4.6.patch",
294+
">=2.4.7 <2.4.7-p2": "MCLOUD-12969__Patch_for_CVE_2024_34102_KeyRotation__2.4.7.patch"
283295
}
284296
},
285297
"magento/module-paypal": {
@@ -370,6 +382,9 @@
370382
"magento/magento2-b2b-base": {
371383
"Layered navigation filter is present only when product is present on the listing page with enabled Shared catalog": {
372384
">=1.1.5 <1.3.1": "MCLOUD-6923__layered_navigation_filter_is_present_only_when_product_is_present_on_the_listing_page_with_enabled_shared_catalog__2.3.5.patch"
385+
},
386+
"Fields hydration on company account create request": {
387+
">=1.3.3 <1.3.3-p11 || >=1.3.4 <1.3.4-p10 || >=1.3.5 <1.3.5-p8 || >=1.4.2 <1.4.2-p3": "B2B-4051__fields_hydration_company_account_create_request__1.3.3.patch"
373388
}
374389
},
375390
"magento/magento2-ee-base": {
@@ -410,5 +425,10 @@
410425
"Fix regexp cache tag validation": {
411426
">=103.0.6 <103.0.7": "MCLOUD-10226__fix_regexp_cache_tag_validation__2.4.6.patch"
412427
}
428+
},
429+
"magento/module-catalog-graph-ql": {
430+
"AttributeReader should use Factory for Collection": {
431+
">=100.4.7 <100.4.8": "ACPT-1876__attribute_reader_should_use_factory_for_collection__2.4.7.patch"
432+
}
413433
}
414434
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
From c964bc3248811dc63df6205a1246d383ad4c6e4a Mon Sep 17 00:00:00 2001
2+
From: Jacob Brown <jacob@gnu.org>
3+
Date: Wed, 3 Apr 2024 14:07:21 -0500
4+
Subject: [PATCH] ACPT-1854: AttributeReader should use Factory for Collection
5+
6+
---
7+
.../Model/Config/AttributeReader.php | 18 +++++++++++-------
8+
1 file changed, 11 insertions(+), 7 deletions(-)
9+
10+
diff --git a/vendor/magento/module-catalog-graph-ql/Model/Config/AttributeReader.php b/vendor/magento/module-catalog-graph-ql/Model/Config/AttributeReader.php
11+
index ecd83bf61ef0..05acb97e4bd7 100644
12+
--- a/vendor/magento/module-catalog-graph-ql/Model/Config/AttributeReader.php
13+
+++ b/vendor/magento/module-catalog-graph-ql/Model/Config/AttributeReader.php
14+
@@ -9,8 +9,10 @@
15+
use Magento\Catalog\Model\Product;
16+
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
17+
use Magento\CatalogGraphQl\Model\Resolver\Products\Attributes\Collection;
18+
+use Magento\CatalogGraphQl\Model\Resolver\Products\Attributes\CollectionFactory;
19+
use Magento\EavGraphQl\Model\Resolver\Query\Type;
20+
use Magento\Framework\App\Config\ScopeConfigInterface;
21+
+use Magento\Framework\App\ObjectManager;
22+
use Magento\Framework\Config\ReaderInterface;
23+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
24+
use Magento\Framework\GraphQl\Schema\Type\Entity\MapperInterface;
25+
@@ -36,9 +38,9 @@ class AttributeReader implements ReaderInterface
26+
private Type $typeLocator;
27+
28+
/**
29+
- * @var Collection
30+
+ * @var CollectionFactory
31+
*/
32+
- private Collection $collection;
33+
+ private CollectionFactory $collectionFactory;
34+
35+
/**
36+
* @var ScopeConfigInterface
37+
@@ -48,18 +50,21 @@ class AttributeReader implements ReaderInterface
38+
/**
39+
* @param MapperInterface $mapper
40+
* @param Type $typeLocator
41+
- * @param Collection $collection
42+
+ * @param Collection $collection @deprecated @see $collectionFactory
43+
* @param ScopeConfigInterface $config
44+
+ * @param CollectionFactory|null $collectionFactory
45+
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
46+
*/
47+
public function __construct(
48+
MapperInterface $mapper,
49+
Type $typeLocator,
50+
Collection $collection,
51+
- ScopeConfigInterface $config
52+
+ ScopeConfigInterface $config,
53+
+ CollectionFactory $collectionFactory = null,
54+
) {
55+
$this->mapper = $mapper;
56+
$this->typeLocator = $typeLocator;
57+
- $this->collection = $collection;
58+
+ $this->collectionFactory = $collectionFactory ?? ObjectManager::getInstance()->get(CollectionFactory::class);
59+
$this->config = $config;
60+
}
61+
62+
@@ -74,12 +79,11 @@ public function __construct(
63+
public function read($scope = null) : array
64+
{
65+
$config = [];
66+
-
67+
if ($this->config->isSetFlag(self::XML_PATH_INCLUDE_DYNAMIC_ATTRIBUTES, ScopeInterface::SCOPE_STORE)) {
68+
$typeNames = $this->mapper->getMappedTypes(Product::ENTITY);
69+
70+
/** @var Attribute $attribute */
71+
- foreach ($this->collection->getAttributes() as $attribute) {
72+
+ foreach ($this->collectionFactory->create()->getAttributes() as $attribute) {
73+
$attributeCode = $attribute->getAttributeCode();
74+
$locatedType = $this->typeLocator->getType($attributeCode, Product::ENTITY) ?: 'String';
75+
$locatedType = TypeProcessor::NORMALIZED_ANY_TYPE === $locatedType ? 'String' : ucfirst($locatedType);
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
new file mode 100644
2+
--- /dev/null
3+
+++ b/vendor/magento/module-company/Model/Customer/AccountManagement/CompanyRequestHydrator.php
4+
@@ -0,0 +1,66 @@
5+
+<?php
6+
+/**
7+
+ * Copyright © Magento, Inc. All rights reserved.
8+
+ * See COPYING.txt for license details.
9+
+ */
10+
+declare(strict_types=1);
11+
+
12+
+namespace Magento\Company\Model\Customer\AccountManagement;
13+
+
14+
+use Magento\Company\Api\Data\CompanyInterface;
15+
+
16+
+/**
17+
+ * Getting company data form request.
18+
+ */
19+
+class CompanyRequestHydrator
20+
+{
21+
+ /**
22+
+ * @var \Magento\Framework\App\Request\Http
23+
+ */
24+
+ private $request;
25+
+ /**
26+
+ * @var array
27+
+ */
28+
+ private $fieldsToSave = [
29+
+ CompanyInterface::NAME,
30+
+ CompanyInterface::LEGAL_NAME,
31+
+ CompanyInterface::COMPANY_EMAIL,
32+
+ CompanyInterface::VAT_TAX_ID,
33+
+ CompanyInterface::RESELLER_ID,
34+
+ CompanyInterface::STREET,
35+
+ CompanyInterface::CITY,
36+
+ CompanyInterface::COUNTRY_ID,
37+
+ CompanyInterface::REGION,
38+
+ CompanyInterface::REGION_ID,
39+
+ CompanyInterface::POSTCODE,
40+
+ CompanyInterface::TELEPHONE,
41+
+ CompanyInterface::JOB_TITLE
42+
+ ];
43+
+
44+
+ /**
45+
+ * @param \Magento\Framework\App\Request\Http $request
46+
+ */
47+
+ public function __construct(
48+
+ \Magento\Framework\App\Request\Http $request,
49+
+ ) {
50+
+ $this->request = $request;
51+
+ }
52+
+
53+
+ /**
54+
+ * Get and hydrate company data from HTTP request.
55+
+ *
56+
+ * @return array
57+
+ */
58+
+ public function getCompanyDataFromRequest(): array
59+
+ {
60+
+ $result = [];
61+
+ $companyData = $this->request->getPost('company', []);
62+
+ foreach ($this->fieldsToSave as $item) {
63+
+ if (isset($companyData[$item])) {
64+
+ $result[$item] = $companyData[$item];
65+
+ }
66+
+ }
67+
+
68+
+ return $result;
69+
+ }
70+
+}
71+
--- a/vendor/magento/module-company/Plugin/Customer/Api/AccountManagement.php
72+
+++ b/vendor/magento/module-company/Plugin/Customer/Api/AccountManagement.php
73+
@@ -11,17 +11,13 @@
74+
use Magento\Customer\Api\CustomerRepositoryInterface;
75+
use Magento\Company\Api\CompanyManagementInterface;
76+
use Magento\Framework\Exception\NoSuchEntityException;
77+
+use Magento\Company\Model\Customer\AccountManagement\CompanyRequestHydrator;
78+
79+
/**
80+
* Plugin for AccountManagement. Processing company data.
81+
*/
82+
class AccountManagement
83+
{
84+
- /**
85+
- * @var \Magento\Framework\App\Request\Http
86+
- */
87+
- private $request;
88+
-
89+
/**
90+
* @var \Magento\Company\Model\Email\Sender
91+
*/
92+
@@ -47,30 +43,35 @@
93+
*/
94+
private $customerRepository;
95+
96+
+ /**
97+
+ * @var CompanyRequestHydrator
98+
+ */
99+
+ private $companyRequestHydrator;
100+
+
101+
/**
102+
* AccountManagement constructor
103+
*
104+
- * @param \Magento\Framework\App\Request\Http $request
105+
* @param \Magento\Company\Model\Email\Sender $companyEmailSender
106+
* @param \Magento\Backend\Model\UrlInterface $urlBuilder
107+
* @param \Magento\Company\Model\Customer\Company $customerCompany
108+
* @param CompanyManagementInterface $companyManagement
109+
* @param CustomerRepositoryInterface $customerRepository
110+
+ * @param CompanyRequestHydrator $companyRequestHydrator
111+
*/
112+
public function __construct(
113+
- \Magento\Framework\App\Request\Http $request,
114+
\Magento\Company\Model\Email\Sender $companyEmailSender,
115+
\Magento\Backend\Model\UrlInterface $urlBuilder,
116+
\Magento\Company\Model\Customer\Company $customerCompany,
117+
CompanyManagementInterface $companyManagement,
118+
- CustomerRepositoryInterface $customerRepository
119+
+ CustomerRepositoryInterface $customerRepository,
120+
+ CompanyRequestHydrator $companyRequestHydrator
121+
) {
122+
- $this->request = $request;
123+
$this->companyEmailSender = $companyEmailSender;
124+
$this->urlBuilder = $urlBuilder;
125+
$this->customerCompany = $customerCompany;
126+
$this->companyManagement = $companyManagement;
127+
$this->customerRepository = $customerRepository;
128+
+ $this->companyRequestHydrator = $companyRequestHydrator;
129+
}
130+
131+
/**
132+
@@ -127,11 +128,7 @@
133+
\Magento\Customer\Api\AccountManagementInterface $subject,
134+
\Magento\Customer\Api\Data\CustomerInterface $result
135+
) {
136+
- $companyData = $this->request->getPost('company', []);
137+
- if (isset($companyData['status'])) {
138+
- unset($companyData['status']);
139+
- }
140+
-
141+
+ $companyData = $this->companyRequestHydrator->getCompanyDataFromRequest();
142+
if (is_array($companyData) && !empty($companyData)) {
143+
$jobTitle = $companyData['job_title'] ?? null;
144+
$companyDataObject = $this->customerCompany->createCompany($result, $companyData, $jobTitle);
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
diff --git a/vendor/magento/theme-frontend-blank/i18n/en_US.csv b/vendor/magento/theme-frontend-blank/i18n/en_US.csv
2+
index a491a567a37..5e8bef787d2 100644
3+
--- a/vendor/magento/theme-frontend-blank/i18n/en_US.csv
4+
+++ b/vendor/magento/theme-frontend-blank/i18n/en_US.csv
5+
@@ -4,3 +4,4 @@ Summary,Summary
6+
Menu,Menu
7+
Account,Account
8+
Settings,Settings
9+
+"Invalid data type","Invalid data type"
10+
diff --git a/vendor/magento/theme-frontend-luma/i18n/en_US.csv b/vendor/magento/theme-frontend-luma/i18n/en_US.csv
11+
index 7bf9e0afaf0..00493cc05ba 100644
12+
--- a/vendor/magento/theme-frontend-luma/i18n/en_US.csv
13+
+++ b/vendor/magento/theme-frontend-luma/i18n/en_US.csv
14+
@@ -54,3 +54,4 @@ Footer,Footer
15+
"Update to your %store_name shipment","Update to your %store_name shipment"
16+
"Address Book","Address Book"
17+
"Account Information","Account Information"
18+
+"Invalid data type","Invalid data type"
19+
diff --git a/vendor/magento/framework/Webapi/ServiceInputProcessor.php b/vendor/magento/framework/Webapi/ServiceInputProcessor.php
20+
index 908a4e70140..cc019845b58 100644
21+
--- a/vendor/magento/framework/Webapi/ServiceInputProcessor.php
22+
+++ b/vendor/magento/framework/Webapi/ServiceInputProcessor.php
23+
@@ -153,6 +153,7 @@ class ServiceInputProcessor implements ServicePayloadConverterInterface
24+
* @return \Magento\Framework\Reflection\NameFinder
25+
*
26+
* @deprecated 100.1.0
27+
+ * @see nothing
28+
*/
29+
private function getNameFinder()
30+
{
31+
@@ -261,6 +262,7 @@ class ServiceInputProcessor implements ServicePayloadConverterInterface
32+
* @throws \Exception
33+
* @throws SerializationException
34+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
35+
+ * @SuppressWarnings(PHPMD.NPathComplexity)
36+
*/
37+
protected function _createFromArray($className, $data)
38+
{
39+
@@ -268,6 +270,12 @@ class ServiceInputProcessor implements ServicePayloadConverterInterface
40+
// convert to string directly to avoid situations when $className is object
41+
// which implements __toString method like \ReflectionObject
42+
$className = (string) $className;
43+
+ if (is_subclass_of($className, \SimpleXMLElement::class)
44+
+ || is_subclass_of($className, \DOMElement::class)) {
45+
+ throw new SerializationException(
46+
+ new Phrase('Invalid data type')
47+
+ );
48+
+ }
49+
$class = new ClassReflection($className);
50+
if (is_subclass_of($className, self::EXTENSION_ATTRIBUTES_TYPE)) {
51+
$className = substr($className, 0, -strlen('Interface'));
52+
diff --git a/vendor/magento/module-jwt-user-token/Model/SecretBasedJwksFactory.php b/vendor/magento/module-jwt-user-token/Model/SecretBasedJwksFactory.php
53+
--- a/vendor/magento/module-jwt-user-token/Model/SecretBasedJwksFactory.php (revision 022e64b08a88658667bc2d6b922eada2b7910965)
54+
+++ b/vendor/magento/module-jwt-user-token/Model/SecretBasedJwksFactory.php (revision 8d2b0c1c6b421cdcd7f62a48a5edc9b0211d92a2)
55+
@@ -35,6 +35,7 @@
56+
public function __construct(DeploymentConfig $deploymentConfig, JwkFactory $jwkFactory)
57+
{
58+
$this->keys = preg_split('/\s+/s', trim((string)$deploymentConfig->get('crypt/key')));
59+
+ $this->keys = [end($this->keys)];
60+
//Making sure keys are large enough.
61+
foreach ($this->keys as &$key) {
62+
$key = str_pad($key, 2048, '&', STR_PAD_BOTH);

0 commit comments

Comments
 (0)