Skip to content

Commit 7587503

Browse files
authored
Merge pull request #80 from magento-commerce/develop
MCLOUD-10674: Release MCP 1.0.22
2 parents 9b0aeb2 + 7dae97f commit 7587503

20 files changed

+416
-13
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento-cloud-patches",
33
"description": "Provides critical fixes for Magento 2 Enterprise Edition",
44
"type": "magento2-component",
5-
"version": "1.0.21",
5+
"version": "1.0.22",
66
"license": "OSL-3.0",
77
"repositories": {
88
"repo.magento.com": {

patches.json

+15
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,16 @@
264264
},
265265
"Fixed currency displaying on product page": {
266266
">=2.4.3 <2.4.4": "MCLOUD-8279__Fixed_currency_displaying_on_product_page__2.4.3.patch"
267+
},
268+
"Auto increment number jumping up for catalog_product_entity_* tables": {
269+
">=2.3.7 <2.4.7": "MCLOUD-10032__Increment_number_for_catalog_product_entity_tables__2.4.3-p1.patch"
270+
},
271+
"Fixes the error 'The file can't be deleted. Warning!unlink: No such file or directory' when flushing JS/CSS cache from the Admin": {
272+
">=2.4.0 <2.4.1-p1": "MCLOUD-10279__errors_when_flushing_js_css_cache_from_admin__2.4.0.patch",
273+
">=2.4.1-p1 <2.4.7": "MCLOUD-10279__errors_when_flushing_js_css_cache_from_admin__2.4.4.patch"
274+
},
275+
"Reduced the number of times the same deployment configurations load": {
276+
">=2.4.6 <2.4.7": "MCLOUD-10604__performance_degradation_around_deployment_configuration__2.4.6.patch"
267277
}
268278
},
269279
"magento/module-paypal": {
@@ -389,5 +399,10 @@
389399
">=2.3.4-p2 <2.3.7-p3 || >=2.4.0 <2.4.3": "MDVA-43443__parser_token_new_fix__2.3.4-p2.patch",
390400
">=2.4.3 <2.4.3-p2": "MDVA-43443__parser_token_new_fix__2.4.3.patch"
391401
}
402+
},
403+
"magento/framework": {
404+
"Fix regexp cache tag validation": {
405+
">=103.0.6 <103.0.7": "MCLOUD-10226__fix_regexp_cache_tag_validation__2.4.6.patch"
406+
}
392407
}
393408
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff -Nuar a/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php b/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php
2+
index c71225b4fc6..3f0ee96d70e 100644
3+
--- a/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php
4+
+++ b/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php
5+
@@ -24,14 +24,14 @@ use Magento\Eav\Model\Entity\Attribute\UniqueValidationInterface;
6+
abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity
7+
{
8+
/**
9+
- * Store manager
10+
+ * Store manager to get the store information
11+
*
12+
* @var \Magento\Store\Model\StoreManagerInterface
13+
*/
14+
protected $_storeManager;
15+
16+
/**
17+
- * Model factory
18+
+ * Model factory to create a model object
19+
*
20+
* @var \Magento\Catalog\Model\Factory
21+
*/
22+
@@ -325,7 +325,25 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity
23+
*/
24+
protected function _updateAttribute($object, $attribute, $valueId, $value)
25+
{
26+
- return $this->_saveAttributeValue($object, $attribute, $value);
27+
+ $entity = $attribute->getEntity();
28+
+ $row = $this->getAttributeRow($entity, $object, $attribute);
29+
+ $hasSingleStore = $this->_storeManager->hasSingleStore();
30+
+ $storeId = $hasSingleStore
31+
+ ? $this->getDefaultStoreId()
32+
+ : (int) $this->_storeManager->getStore($object->getStoreId())->getId();
33+
+ if ($valueId > 0 && array_key_exists('store_id', $row) && $storeId === $row['store_id']) {
34+
+ $table = $attribute->getBackend()->getTable();
35+
+ $connection = $this->getConnection();
36+
+ $connection->update(
37+
+ $table,
38+
+ ['value' => $this->_prepareValueForSave($value, $attribute)],
39+
+ sprintf('%s=%d', $connection->quoteIdentifier('value_id'), $valueId)
40+
+ );
41+
+
42+
+ return $this;
43+
+ } else {
44+
+ return $this->_saveAttributeValue($object, $attribute, $value);
45+
+ }
46+
}
47+
48+
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
diff -Naur a/vendor/magento/framework/Cache/Core.php b/vendor/magento/framework/Cache/Core.php
2+
--- a/vendor/magento/framework/Cache/Core.php 2023-02-23 14:11:04
3+
+++ b/vendor/magento/framework/Cache/Core.php 2023-04-14 11:54:58
4+
@@ -5,6 +5,10 @@ namespace Magento\Framework\Cache;
5+
*/
6+
namespace Magento\Framework\Cache;
7+
8+
+use Magento\Framework\Cache\Backend\Redis;
9+
+use Zend_Cache;
10+
+use Zend_Cache_Exception;
11+
+
12+
class Core extends \Zend_Cache_Core
13+
{
14+
/**
15+
@@ -124,6 +128,34 @@ class Core extends \Zend_Cache_Core
16+
{
17+
$tags = $this->_tags($tags);
18+
return parent::getIdsNotMatchingTags($tags);
19+
+ }
20+
+
21+
+ /**
22+
+ * Validate a cache id or a tag (security, reliable filenames, reserved prefixes...)
23+
+ *
24+
+ * Throw an exception if a problem is found
25+
+ *
26+
+ * @param string $string Cache id or tag
27+
+ * @throws Zend_Cache_Exception
28+
+ * @return void
29+
+ */
30+
+ protected function _validateIdOrTag($string)
31+
+ {
32+
+ if ($this->_backend instanceof Redis) {
33+
+ if (!is_string($string)) {
34+
+ Zend_Cache::throwException('Invalid id or tag : must be a string');
35+
+ }
36+
+ if (substr($string, 0, 9) == 'internal-') {
37+
+ Zend_Cache::throwException('"internal-*" ids or tags are reserved');
38+
+ }
39+
+ if (!preg_match('~^[a-zA-Z0-9_{}]+$~D', $string)) {
40+
+ Zend_Cache::throwException("Invalid id or tag '$string' : must use only [a-zA-Z0-9_{}]");
41+
+ }
42+
+
43+
+ return;
44+
+ }
45+
+
46+
+ parent::_validateIdOrTag($string);
47+
}
48+
49+
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff -Nuar a/vendor/magento/framework/Filesystem/Driver/File.php b/vendor/magento/framework/Filesystem/Driver/File.php
2+
index 1affad552137..4edb095f6c48 100644
3+
--- a/vendor/magento/framework/Filesystem/Driver/File.php
4+
+++ b/vendor/magento/framework/Filesystem/Driver/File.php
5+
@@ -391,8 +391,8 @@ public function symlink($source, $destination, DriverInterface $targetDriver = n
6+
*/
7+
public function deleteFile($path)
8+
{
9+
- $result = @unlink($this->getScheme() . $path);
10+
- if (!$result) {
11+
+ @unlink($this->getScheme() . $path);
12+
+ if ($this->isFile($path)) {
13+
throw new FileSystemException(
14+
new Phrase(
15+
'The "%1" file can\'t be deleted. %2',
16+
@@ -400,7 +400,7 @@ public function deleteFile($path)
17+
)
18+
);
19+
}
20+
- return $result;
21+
+ return true;
22+
}
23+
24+
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff -Nuar a/vendor/magento/framework/Filesystem/Driver/File.php b/vendor/magento/framework/Filesystem/Driver/File.php
2+
index 5dcfeeef23ab..e26acb5a9369 100644
3+
--- a/vendor/magento/framework/Filesystem/Driver/File.php
4+
+++ b/vendor/magento/framework/Filesystem/Driver/File.php
5+
@@ -440,11 +440,12 @@ public function symlink($source, $destination, DriverInterface $targetDriver = n
6+
*/
7+
public function deleteFile($path)
8+
{
9+
- $result = @unlink($this->getScheme() . $path);
10+
+ @unlink($this->getScheme() . $path);
11+
if ($this->stateful) {
12+
clearstatcache(true, $this->getScheme() . $path);
13+
}
14+
- if (!$result) {
15+
+
16+
+ if ($this->isFile($path)) {
17+
throw new FileSystemException(
18+
new Phrase(
19+
'The "%1" file can\'t be deleted. %2',
20+
@@ -452,7 +453,7 @@ public function deleteFile($path)
21+
)
22+
);
23+
}
24+
- return $result;
25+
+ return true;
26+
}
27+
28+
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
diff -Nuar a/vendor/magento/framework/App/DeploymentConfig.php b/vendor/magento/framework/App/DeploymentConfig.php
2+
index 6713baa3a1d..64f32d5516b 100644
3+
--- a/vendor/magento/framework/App/DeploymentConfig.php
4+
+++ b/vendor/magento/framework/App/DeploymentConfig.php
5+
@@ -51,6 +51,16 @@ class DeploymentConfig
6+
*/
7+
private $overrideData;
8+
9+
+ /**
10+
+ * @var array
11+
+ */
12+
+ private $envOverrides = [];
13+
+
14+
+ /**
15+
+ * @var array
16+
+ */
17+
+ private $readerLoad = [];
18+
+
19+
/**
20+
* Constructor
21+
*
22+
@@ -84,7 +94,9 @@ class DeploymentConfig
23+
}
24+
$result = $this->getByKey($key);
25+
if ($result === null) {
26+
- $this->reloadData();
27+
+ if (empty($this->flatData) || count($this->getAllEnvOverrides())) {
28+
+ $this->reloadData();
29+
+ }
30+
$result = $this->getByKey($key);
31+
}
32+
return $result ?? $defaultValue;
33+
@@ -114,13 +126,13 @@ class DeploymentConfig
34+
{
35+
if ($key === null) {
36+
if (empty($this->data)) {
37+
- $this->reloadData();
38+
+ $this->reloadInitialData();
39+
}
40+
return $this->data;
41+
}
42+
$result = $this->getConfigDataByKey($key);
43+
if ($result === null) {
44+
- $this->reloadData();
45+
+ $this->reloadInitialData();
46+
$result = $this->getConfigDataByKey($key);
47+
}
48+
return $result;
49+
@@ -170,28 +182,55 @@ class DeploymentConfig
50+
* @throws FileSystemException
51+
* @throws RuntimeException
52+
*/
53+
- private function reloadData(): void
54+
+ private function reloadInitialData(): void
55+
{
56+
+ if (empty($this->readerLoad) || empty($this->data) || empty($this->flatData)) {
57+
+ $this->readerLoad = $this->reader->load();
58+
+ }
59+
$this->data = array_replace(
60+
- $this->reader->load(),
61+
+ $this->readerLoad,
62+
$this->overrideData ?? [],
63+
$this->getEnvOverride()
64+
);
65+
+ }
66+
+
67+
+ /**
68+
+ * Loads the configuration data
69+
+ *
70+
+ * @return void
71+
+ * @throws FileSystemException
72+
+ * @throws RuntimeException
73+
+ */
74+
+ private function reloadData(): void
75+
+ {
76+
+ $this->reloadInitialData();
77+
// flatten data for config retrieval using get()
78+
$this->flatData = $this->flattenParams($this->data);
79+
+ $this->flatData = $this->getAllEnvOverrides() + $this->flatData;
80+
+ }
81+
82+
- // allow reading values from env variables by convention
83+
- // MAGENTO_DC_{path}, like db/connection/default/host =>
84+
- // can be overwritten by MAGENTO_DC_DB__CONNECTION__DEFAULT__HOST
85+
- foreach (getenv() as $key => $value) {
86+
- if (false !== \strpos($key, self::MAGENTO_ENV_PREFIX)
87+
- && $key !== self::OVERRIDE_KEY
88+
- ) {
89+
- // convert MAGENTO_DC_DB__CONNECTION__DEFAULT__HOST into db/connection/default/host
90+
- $flatKey = strtolower(str_replace([self::MAGENTO_ENV_PREFIX, '__'], ['', '/'], $key));
91+
- $this->flatData[$flatKey] = $value;
92+
+ /**
93+
+ * Load all getenv() configs once
94+
+ *
95+
+ * @return array
96+
+ */
97+
+ private function getAllEnvOverrides(): array
98+
+ {
99+
+ if (empty($this->envOverrides)) {
100+
+ // allow reading values from env variables by convention
101+
+ // MAGENTO_DC_{path}, like db/connection/default/host =>
102+
+ // can be overwritten by MAGENTO_DC_DB__CONNECTION__DEFAULT__HOST
103+
+ foreach (getenv() as $key => $value) {
104+
+ if (false !== \strpos($key, self::MAGENTO_ENV_PREFIX)
105+
+ && $key !== self::OVERRIDE_KEY
106+
+ ) {
107+
+ // convert MAGENTO_DC_DB__CONNECTION__DEFAULT__HOST into db/connection/default/host
108+
+ $flatKey = strtolower(str_replace([self::MAGENTO_ENV_PREFIX, '__'], ['', '/'], $key));
109+
+ $this->envOverrides[$flatKey] = $value;
110+
+ }
111+
}
112+
}
113+
+ return $this->envOverrides;
114+
}
115+
116+
/**
117+
diff -Nuar a/vendor/magento/framework/Module/ModuleList.php b/vendor/magento/framework/Module/ModuleList.php
118+
index b3cf433bbaf..32e2d2b1550 100644
119+
--- a/vendor/magento/framework/Module/ModuleList.php
120+
+++ b/vendor/magento/framework/Module/ModuleList.php
121+
@@ -140,8 +140,11 @@ class ModuleList implements ModuleListInterface
122+
*/
123+
private function loadConfigData()
124+
{
125+
- if (null === $this->configData && null !== $this->config->get(ConfigOptionsListConstants::KEY_MODULES)) {
126+
- $this->configData = $this->config->get(ConfigOptionsListConstants::KEY_MODULES);
127+
+ if (null === $this->configData) {
128+
+ $config = $this->config->get(ConfigOptionsListConstants::KEY_MODULES);
129+
+ if (null !== $config) {
130+
+ $this->configData = $config;
131+
+ }
132+
}
133+
}
134+
}

src/Command/Process/Action/ConfirmRequiredAction.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
class ConfirmRequiredAction implements ActionInterface
2323
{
24+
const PATCH_INFO_URL = "https://experienceleague.adobe.com/tools/commerce-quality-patches/index.html";
25+
2426
/**
2527
* @var OptionalPool
2628
*/
@@ -76,10 +78,16 @@ function ($patch) {
7678
}
7779

7880
if ($requiredNotAppliedPatches) {
81+
$url = self::PATCH_INFO_URL . '?keyword=' . current($patchFilter);
82+
$output->writeln(
83+
'<info>Please double check patch details and requirements at ' .
84+
sprintf('<href=%1$s>%1$s</>', $url) .
85+
'</info>' .
86+
PHP_EOL
87+
);
7988
$output->writeln(
8089
'<info>Next patches are required by ' . implode(' ', $patchFilter) . ':</info>' . PHP_EOL
8190
);
82-
8391
$aggregatedPatches = $this->aggregator->aggregate($requiredNotAppliedPatches);
8492
$this->renderer->printTable($output, $aggregatedPatches);
8593

src/Command/Process/Renderer.php

+5
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ function ($item) {
220220
$details .= 'Affected components:' . $glue . implode($glue, $patch->getAffectedComponents());
221221
}
222222

223+
if ($patch->getRequirements()) {
224+
$requirements = rtrim(chunk_split($patch->getRequirements(), 50, PHP_EOL));
225+
$details .= PHP_EOL . '<comment>Requirements:</comment>' . PHP_EOL . ' - ' . $requirements;
226+
}
227+
223228
$id = $patch->getType() === PatchInterface::TYPE_CUSTOM ? 'N/A' : $patch->getId();
224229
$title = chunk_split($patch->getTitle(), 60, PHP_EOL);
225230

src/Command/Process/ShowStatus.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ private function getPatchCategories(array $patches): array
284284
*/
285285
private function printDetailsInfo(OutputInterface $output)
286286
{
287-
$supportUrl = 'https://support.magento.com';
288-
$releaseNotesUrl = 'https://devdocs.magento.com/quality-patches/release-notes.html';
287+
// phpcs:ignore
288+
$releaseNotesUrl = 'https://experienceleague.adobe.com/docs/commerce-operations/tools/quality-patches-tool/release-notes.html';
289+
$supportUrl = 'https://experienceleague.adobe.com/tools/commerce-quality-patches/index.html';
289290

290291
$output->writeln(
291292
'<info>Patch details you can find on </info>' .

0 commit comments

Comments
 (0)