Skip to content

Commit 1e149b6

Browse files
merge magento-commerce/2.4-develop into magento-tsg/MC-41213
2 parents b8ed315 + 8010e79 commit 1e149b6

File tree

5 files changed

+12
-61
lines changed

5 files changed

+12
-61
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -25,58 +25,4 @@ protected function _productLimitationJoinPrice()
2525
$this->_productLimitationFilters->setUsePriceIndex(false);
2626
return $this->_productLimitationPrice(true);
2727
}
28-
29-
/**
30-
* Return approximately amount if too much entities.
31-
*
32-
* @return int|mixed
33-
*/
34-
public function getSize()
35-
{
36-
$sql = $this->getSelectCountSql();
37-
$possibleCount = $this->analyzeCount($sql);
38-
39-
if ($possibleCount > 20000) {
40-
return $possibleCount;
41-
}
42-
43-
return parent::getSize();
44-
}
45-
46-
/**
47-
* Analyze amount of entities in DB.
48-
*
49-
* @param $sql
50-
* @return int|mixed
51-
* @throws \Zend_Db_Statement_Exception
52-
*/
53-
private function analyzeCount($sql)
54-
{
55-
$results = $this->getConnection()->query('EXPLAIN ' . $sql)->fetchAll();
56-
$alias = $this->getMainTableAlias();
57-
58-
foreach ($results as $result) {
59-
if ($result['table'] == $alias) {
60-
return $result['rows'];
61-
}
62-
}
63-
64-
return 0;
65-
}
66-
67-
/**
68-
* Identify main table alias or its name if alias is not defined.
69-
*
70-
* @return string
71-
* @throws \LogicException
72-
*/
73-
private function getMainTableAlias()
74-
{
75-
foreach ($this->getSelect()->getPart(\Magento\Framework\DB\Select::FROM) as $tableAlias => $tableMetadata) {
76-
if ($tableMetadata['joinType'] == 'from') {
77-
return $tableAlias;
78-
}
79-
}
80-
throw new \LogicException("Main table cannot be identified.");
81-
}
8228
}

app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,14 @@ public function swapIndexTables(array $originalTablesNames)
122122
$this->resourceConnection->getConnection()->dropTable($tableName);
123123
}
124124
}
125+
126+
/**
127+
* Cleanup leftover temporary tables
128+
*/
129+
public function __destruct()
130+
{
131+
foreach ($this->temporaryTables as $tableName) {
132+
$this->resourceConnection->getConnection()->dropTable($tableName);
133+
}
134+
}
125135
}

app/code/Magento/Sales/etc/adminhtml/di.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,4 @@
4848
</argument>
4949
</arguments>
5050
</type>
51-
<type name="Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid\DataProvider\ProductCollection">
52-
<arguments>
53-
<argument name="collectionFactory" xsi:type="object">\Magento\Catalog\Ui\DataProvider\Product\ProductCollectionFactory</argument>
54-
</arguments>
55-
</type>
5651
</config>

app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
<field name="stop_rules_processing" formElement="checkbox">
494494
<argument name="data" xsi:type="array">
495495
<item name="config" xsi:type="array">
496-
<item name="default" xsi:type="number">0</item>
496+
<item name="default" xsi:type="number">1</item>
497497
<item name="source" xsi:type="string">sales_rule</item>
498498
</item>
499499
</argument>

setup/src/Magento/Setup/Fixtures/CartPriceRulesFixture.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function generateRules($ruleFactory, $categoriesArray)
199199
'discount_step' => '',
200200
'apply_to_shipping' => '0',
201201
'simple_free_shipping' => '0',
202-
'stop_rules_processing' => '0',
202+
'stop_rules_processing' => '1',
203203
'reward_points_delta' => '',
204204
'store_labels' => [
205205
0 => '',

0 commit comments

Comments
 (0)