Skip to content

Commit 3dc08f7

Browse files
authored
Merge pull request #173 from magento-commerce/1.1.54-release
1.1.54 Release
2 parents b397107 + 566fd62 commit 3dc08f7

19 files changed

+3889
-3
lines changed

composer.json

+1-1
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.53",
5+
"version": "1.1.54",
66
"license": "proprietary",
77
"repositories": {
88
"repo": {

patches-info.json

+1-1
Large diffs are not rendered by default.
+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
diff --git a/vendor/magento/module-versions-cms/Setup/Patch/Data/UpdateNodes.php b/vendor/magento/module-versions-cms/Setup/Patch/Data/UpdateNodes.php
2+
new file mode 100644
3+
index 000000000000..76686046cf2c
4+
--- /dev/null
5+
+++ b/vendor/magento/module-versions-cms/Setup/Patch/Data/UpdateNodes.php
6+
@@ -0,0 +1,141 @@
7+
+<?php
8+
+/**************************************************************************
9+
+ *
10+
+ * ADOBE CONFIDENTIAL
11+
+ * ___________________
12+
+ *
13+
+ * Copyright 2024 Adobe
14+
+ * All Rights Reserved.
15+
+ *
16+
+ * NOTICE: All information contained herein is, and remains
17+
+ * the property of Adobe and its suppliers, if any. The intellectual
18+
+ * and technical concepts contained herein are proprietary to Adobe
19+
+ * and its suppliers and are protected by all applicable intellectual
20+
+ * property laws, including trade secret and copyright laws.
21+
+ * Dissemination of this information or reproduction of this material
22+
+ * is strictly forbidden unless prior written permission is obtained
23+
+ * from Adobe.
24+
+ * ************************************************************************
25+
+ */
26+
+declare(strict_types=1);
27+
+
28+
+namespace Magento\VersionsCms\Setup\Patch\Data;
29+
+
30+
+use Magento\Framework\Setup\ModuleDataSetupInterface;
31+
+use Magento\Framework\Setup\Patch\DataPatchInterface;
32+
+use Magento\Framework\Setup\Patch\PatchVersionInterface;
33+
+
34+
+/**
35+
+ * Update existing nodes to avoid nodes with id 2
36+
+ */
37+
+class UpdateNodes implements DataPatchInterface, PatchVersionInterface
38+
+{
39+
+ /**
40+
+ * @var ModuleDataSetupInterface
41+
+ */
42+
+ private $moduleDataSetup;
43+
+
44+
+ /**
45+
+ * @param ModuleDataSetupInterface $moduleDataSetup
46+
+ */
47+
+ public function __construct(
48+
+ ModuleDataSetupInterface $moduleDataSetup
49+
+ ) {
50+
+ $this->moduleDataSetup = $moduleDataSetup;
51+
+ }
52+
+
53+
+ /**
54+
+ * @inheritdoc
55+
+ */
56+
+ public function apply()
57+
+ {
58+
+ $connection = $this->moduleDataSetup->getConnection('sales');
59+
+ $table = $this->moduleDataSetup->getTable('magento_versionscms_hierarchy_node');
60+
+ $dbName = $connection->fetchOne('SELECT DATABASE()');
61+
+ $incrementSelect = clone $connection->select();
62+
+ $incrementSelect->from('INFORMATION_SCHEMA.TABLES', 'AUTO_INCREMENT')
63+
+ ->where('TABLE_SCHEMA = ?', $dbName)
64+
+ ->where('TABLE_NAME = ?', $table);
65+
+ $autoIncrementValue = $connection->fetchOne($incrementSelect);
66+
+
67+
+ if ($autoIncrementValue <= 2) {
68+
+ $node1 = uniqid();
69+
+ $node2 = uniqid();
70+
+ $connection->insertMultiple(
71+
+ $table,
72+
+ [
73+
+ ['request_url' => $node1, 'scope' => 'default', 'scope_id' => 1, 'page_id' => 1],
74+
+ ['request_url' => $node2, 'scope' => 'default', 'scope_id' => 1, 'page_id' => 2],
75+
+ ]
76+
+ );
77+
+ $connection->delete($table, ["request_url='{$node1}' OR request_url='{$node2}'"]);
78+
+ } else {
79+
+ $select = $connection->select()->from($table)->where('node_id=?', 2);
80+
+ $row = $connection->fetchRow($select);
81+
+ if (is_array($row) && !empty($row['node_id'])) {
82+
+ $requestUrl = $row['request_url'];
83+
+ $connection->insertMultiple(
84+
+ $table,
85+
+ [
86+
+ [
87+
+ 'parent_node_id' => $row['parent_node_id'],
88+
+ 'page_id' => $row['page_id'],
89+
+ 'identifier' => $row['identifier'],
90+
+ 'label' => $row['label'],
91+
+ 'level' => $row['level'],
92+
+ 'sort_order' => $row['sort_order'],
93+
+ 'request_url' => uniqid(),
94+
+ 'xpath' => $row['xpath'],
95+
+ 'scope' => $row['scope'],
96+
+ 'scope_id' => $row['scope_id']
97+
+ ],
98+
+ ]
99+
+ );
100+
+ $newId = $connection->lastInsertId();
101+
+ $metaTable = $this->moduleDataSetup->getTable('magento_versionscms_hierarchy_metadata');
102+
+ $connection->update(
103+
+ $table,
104+
+ ['parent_node_id' => $newId],
105+
+ ['parent_node_id=2']
106+
+ );
107+
+ $connection->update(
108+
+ $metaTable,
109+
+ ['node_id' => $newId],
110+
+ ['node_id=2']
111+
+ );
112+
+ $connection->delete($table, ['node_id=2']);
113+
+ $connection->update(
114+
+ $table,
115+
+ ['request_url' => $requestUrl],
116+
+ ['node_id=2']
117+
+ );
118+
+ }
119+
+ }
120+
+
121+
+ return $this;
122+
+ }
123+
+
124+
+ /**
125+
+ * @inheritdoc
126+
+ */
127+
+ public static function getDependencies()
128+
+ {
129+
+ return [];
130+
+ }
131+
+
132+
+ /**
133+
+ * @inheritdoc
134+
+ */
135+
+ public function getAliases()
136+
+ {
137+
+ return [];
138+
+ }
139+
+
140+
+ /**
141+
+ * @inheritDoc
142+
+ */
143+
+ public static function getVersion()
144+
+ {
145+
+ return '2.0.0';
146+
+ }
147+
+}
148+
+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
diff --git a/vendor/magento/module-advanced-sales-rule/Model/ResourceModel/Rule/Condition/Filter.php b/vendor/magento/module-advanced-sales-rule/Model/ResourceModel/Rule/Condition/Filter.php
2+
index 3d98979b41f9..609b130cb525 100644
3+
--- a/vendor/magento/module-advanced-sales-rule/Model/ResourceModel/Rule/Condition/Filter.php
4+
+++ b/vendor/magento/module-advanced-sales-rule/Model/ResourceModel/Rule/Condition/Filter.php
5+
@@ -5,9 +5,9 @@
6+
*/
7+
namespace Magento\AdvancedSalesRule\Model\ResourceModel\Rule\Condition;
8+
9+
-use Magento\AdvancedRule\Model\Condition\FilterInterface;
10+
use Magento\AdvancedRule\Model\Condition\Filter as FilterModel;
11+
-use Magento\Quote\Model\Quote\Address;
12+
+use Magento\Framework\Exception\LocalizedException;
13+
+use Magento\Framework\DB\Select;
14+
15+
class Filter extends \Magento\Rule\Model\ResourceModel\AbstractResource
16+
{
17+
@@ -23,7 +23,7 @@ protected function _construct()
18+
19+
/**
20+
* @return array
21+
- * @throws \Magento\Framework\Exception\LocalizedException
22+
+ * @throws LocalizedException
23+
*/
24+
public function getFilterTextGenerators()
25+
{
26+
@@ -51,6 +51,20 @@ public function getFilterTextGenerators()
27+
* @return array
28+
*/
29+
public function filterRules(array $filterText)
30+
+ {
31+
+ $connection = $this->getConnection();
32+
+ $results = $connection->fetchAssoc($this->getFilterRulesSelect($filterText));
33+
+ return array_keys($results);
34+
+ }
35+
+
36+
+ /**
37+
+ * Returns a select for filter rules
38+
+ *
39+
+ * @param array $filterText
40+
+ * @return Select
41+
+ * @throws LocalizedException
42+
+ */
43+
+ private function getFilterRulesSelect(array $filterText): Select
44+
{
45+
$connection = $this->getConnection();
46+
$select = $connection->select()->from(
47+
@@ -66,8 +80,7 @@ public function filterRules(array $filterText)
48+
)->having(
49+
'sum(weight) > 0.999'
50+
);
51+
- $results = $connection->fetchAssoc($select);
52+
- return array_keys($results);
53+
+ return $select;
54+
}
55+
56+
/**
57+
diff --git a/vendor/magento/module-advanced-sales-rule/etc/db_schema.xml b/vendor/magento/module-advanced-sales-rule/etc/db_schema.xml
58+
index cabb9d9bc3a8..d5d06f92b49f 100644
59+
--- a/vendor/magento/module-advanced-sales-rule/etc/db_schema.xml
60+
+++ b/vendor/magento/module-advanced-sales-rule/etc/db_schema.xml
61+
@@ -34,10 +34,11 @@
62+
<index referenceId="MAGENTO_SALESRULE_FILTER_RULE_ID" indexType="btree">
63+
<column name="rule_id"/>
64+
</index>
65+
- <index referenceId="MAGENTO_SALESRULE_FILTER_FILTER_TEXT_RULE_ID_GROUP_ID" indexType="btree">
66+
+ <index referenceId="MAGENTO_SALESRULE_FILTER_FILTER_TEXT_RULE_ID_GROUP_ID_WEIGHT" indexType="btree">
67+
<column name="filter_text"/>
68+
<column name="rule_id"/>
69+
<column name="group_id"/>
70+
+ <column name="weight"/>
71+
</index>
72+
</table>
73+
</schema>
74+
diff --git a/vendor/magento/module-advanced-sales-rule/etc/db_schema_whitelist.json b/vendor/magento/module-advanced-sales-rule/etc/db_schema_whitelist.json
75+
index f6b7a7cca568..378ef5e7ad4d 100644
76+
--- a/vendor/magento/module-advanced-sales-rule/etc/db_schema_whitelist.json
77+
+++ b/vendor/magento/module-advanced-sales-rule/etc/db_schema_whitelist.json
78+
@@ -12,7 +12,8 @@
79+
"index": {
80+
"IDX_0270DA9E161D3DE2428F005FE39B89C8": true,
81+
"MAGENTO_SALESRULE_FILTER_RULE_ID": true,
82+
- "MAGENTO_SALESRULE_FILTER_FILTER_TEXT_RULE_ID_GROUP_ID": true
83+
+ "MAGENTO_SALESRULE_FILTER_FILTER_TEXT_RULE_ID_GROUP_ID": true,
84+
+ "MAGENTO_SALESRULE_FILTER_FILTER_TEXT_RULE_ID_GROUP_ID_WEIGHT": true
85+
},
86+
"constraint": {
87+
"PRIMARY": true,
+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
diff --git a/vendor/magento/module-company-credit/Plugin/Company/Model/DataProvider.php b/vendor/magento/module-company-credit/Plugin/Company/Model/DataProvider.php
2+
index bbe387b4fb05..4bc91343ef7f 100644
3+
--- a/vendor/magento/module-company-credit/Plugin/Company/Model/DataProvider.php
4+
+++ b/vendor/magento/module-company-credit/Plugin/Company/Model/DataProvider.php
5+
@@ -9,6 +9,7 @@
6+
use Magento\Company\Model\Company\DataProvider as CompanyDataProvider;
7+
use Magento\CompanyCredit\Api\Data\CreditLimitInterface;
8+
use Magento\CompanyCredit\Api\CreditDataProviderInterface;
9+
+use Magento\Framework\Pricing\PriceCurrencyInterface;
10+
11+
/**
12+
* DataProvider for CompanyCredit form on a company edit page.
13+
@@ -25,24 +26,16 @@ class DataProvider
14+
*/
15+
private $storeManager;
16+
17+
- /**
18+
- * @var \Magento\Directory\Model\Currency
19+
- */
20+
- private $currencyFormatter;
21+
-
22+
/**
23+
* @param CreditDataProviderInterface $creditDataProvider
24+
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
25+
- * @param \Magento\Directory\Model\Currency $currencyFormatter
26+
*/
27+
public function __construct(
28+
CreditDataProviderInterface $creditDataProvider,
29+
- \Magento\Store\Model\StoreManagerInterface $storeManager,
30+
- \Magento\Directory\Model\Currency $currencyFormatter
31+
+ \Magento\Store\Model\StoreManagerInterface $storeManager
32+
) {
33+
$this->creditDataProvider = $creditDataProvider;
34+
$this->storeManager = $storeManager;
35+
- $this->currencyFormatter = $currencyFormatter;
36+
}
37+
38+
/**
39+
@@ -62,9 +55,11 @@ public function afterGetCompanyResultData(CompanyDataProvider $subject, array $r
40+
$creditData[CreditLimitInterface::CURRENCY_CODE] = $creditLimit->getCurrencyCode()
41+
? $creditLimit->getCurrencyCode()
42+
: $this->storeManager->getStore()->getBaseCurrency()->getCurrencyCode();
43+
- $creditData[CreditLimitInterface::CREDIT_LIMIT] = $this->currencyFormatter->formatTxt(
44+
- $creditLimit->getCreditLimit(),
45+
- ['display' => \Magento\Framework\Currency\Data\Currency::NO_SYMBOL]
46+
+ $creditData[CreditLimitInterface::CREDIT_LIMIT] = number_format(
47+
+ (float)$creditLimit->getCreditLimit(),
48+
+ PriceCurrencyInterface::DEFAULT_PRECISION,
49+
+ '.',
50+
+ ''
51+
);
52+
} else {
53+
$creditData[CreditLimitInterface::CURRENCY_CODE] = $this->storeManager->getStore()
54+
diff --git a/vendor/magento/module-company-credit/Ui/Component/Form/AmountField.php b/vendor/magento/module-company-credit/Ui/Component/Form/AmountField.php
55+
index 539c10e8f42d..78f1fba6adcd 100644
56+
--- a/vendor/magento/module-company-credit/Ui/Component/Form/AmountField.php
57+
+++ b/vendor/magento/module-company-credit/Ui/Component/Form/AmountField.php
58+
@@ -32,11 +32,6 @@ class AmountField extends Field
59+
*/
60+
private $websiteCurrency;
61+
62+
- /**
63+
- * @var \Magento\Directory\Model\Currency
64+
- */
65+
- private $currencyFormatter;
66+
-
67+
/**
68+
* @var int
69+
*/
70+
@@ -48,7 +43,6 @@ class AmountField extends Field
71+
* @param PriceCurrencyInterface $priceCurrency
72+
* @param CreditDataProviderInterface $creditDataProvider
73+
* @param \Magento\CompanyCredit\Model\WebsiteCurrency $websiteCurrency
74+
- * @param \Magento\Directory\Model\Currency $currencyFormatter
75+
* @param UiComponentInterface[] $components
76+
* @param array $data
77+
*/
78+
@@ -58,7 +52,6 @@ public function __construct(
79+
PriceCurrencyInterface $priceCurrency,
80+
CreditDataProviderInterface $creditDataProvider,
81+
\Magento\CompanyCredit\Model\WebsiteCurrency $websiteCurrency,
82+
- \Magento\Directory\Model\Currency $currencyFormatter,
83+
array $components = [],
84+
array $data = []
85+
) {
86+
@@ -66,7 +59,6 @@ public function __construct(
87+
$this->creditDataProvider = $creditDataProvider;
88+
$this->priceCurrency = $priceCurrency;
89+
$this->websiteCurrency = $websiteCurrency;
90+
- $this->currencyFormatter = $currencyFormatter;
91+
}
92+
93+
/**
94+
@@ -81,9 +73,11 @@ public function prepare()
95+
$config = $this->getData('config');
96+
$currency = $this->getCurrency();
97+
$config['addbefore'] = $this->priceCurrency->getCurrencySymbol(null, $currency);
98+
- $config['value'] = $this->currencyFormatter->formatTxt(
99+
- $this->defaultFieldValue,
100+
- ['display' => \Magento\Framework\Currency\Data\Currency::NO_SYMBOL]
101+
+ $config['value'] = number_format(
102+
+ (float)$this->defaultFieldValue,
103+
+ PriceCurrencyInterface::DEFAULT_PRECISION,
104+
+ '.',
105+
+ ''
106+
);
107+
108+
$this->setData('config', $config);
109+

0 commit comments

Comments
 (0)