forked from ConvertGroupsAS/magento2-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Patch-Magento_Catalog-M2.1.4-product-flat-indexer-v2.patch
28 lines (28 loc) · 1.48 KB
/
Patch-Magento_Catalog-M2.1.4-product-flat-indexer-v2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- Model/Indexer/Product/Flat/Action/Indexer.php
+++ Model/Indexer/Product/Flat/Action/Indexer.php
@@ -96,6 +96,16 @@ class Indexer
if (isset($describe[$columnName])) {
$ids[$attribute->getId()] = $columnName;
}
+ if (in_array($columnName, [
+ 'special_price',
+ 'cost',
+ 'news_from_date',
+ 'news_to_date',
+ 'special_from_date',
+ 'special_to_date'
+ ])) {
+ $updateData[$columnName] = null;
+ }
}
$linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField();
$select->joinLeft(
@@ -123,7 +133,7 @@ class Indexer
while ($row = $cursor->fetch(\Zend_Db::FETCH_ASSOC)) {
$updateData[$ids[$row['attribute_id']]] = $row['value'];
$valueColumnName = $ids[$row['attribute_id']] . $valueFieldSuffix;
- if (isset($describe[$valueColumnName])) {
+ if (isset($describe[$valueColumnName]) && (is_int($row['value']) || ctype_digit($row['value']))) {
$valueColumns[$row['value']] = $valueColumnName;
}
}