Skip to content

Commit f599a3b

Browse files
authored
Merge pull request #236 from magento-performance/MAGETWO-56591
- MAGETWO-56591: Configurable product not visible in category on frontend after creation
2 parents bb49726 + 549bc1b commit f599a3b

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPrice.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,16 @@ public function __construct(
5656
public function build($productId)
5757
{
5858
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
59+
$productTable = $this->resource->getTableName('catalog_product_entity');
5960

6061
return [$this->resource->getConnection()->select()
61-
->from(['parent' => 'catalog_product_entity'], '')
62+
->from(['parent' => $productTable], '')
6263
->joinInner(
6364
['link' => $this->resource->getTableName('catalog_product_relation')],
6465
"link.parent_id = parent.$linkField",
6566
[]
6667
)->joinInner(
67-
['child' => 'catalog_product_entity'],
68+
['child' => $productTable],
6869
"child.entity_id = link.child_id",
6970
['entity_id']
7071
)->joinInner(

app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByBasePrice.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,16 @@ public function build($productId)
6565
{
6666
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
6767
$priceAttribute = $this->eavConfig->getAttribute(Product::ENTITY, 'price');
68+
$productTable = $this->resource->getTableName('catalog_product_entity');
69+
6870
$priceSelect = $this->resource->getConnection()->select()
69-
->from(['parent' => 'catalog_product_entity'], '')
71+
->from(['parent' => $productTable], '')
7072
->joinInner(
7173
['link' => $this->resource->getTableName('catalog_product_relation')],
7274
"link.parent_id = parent.$linkField",
7375
[]
7476
)->joinInner(
75-
['child' => 'catalog_product_entity'],
77+
['child' => $productTable],
7678
"child.entity_id = link.child_id",
7779
['entity_id']
7880
)->joinInner(

app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,16 @@ public function build($productId)
8686
$specialPriceToDate = $this->eavConfig->getAttribute(Product::ENTITY, 'special_to_date');
8787
$timestamp = $this->localeDate->scopeTimeStamp($this->storeManager->getStore());
8888
$currentDate = $this->dateTime->formatDate($timestamp, false);
89+
$productTable = $this->resource->getTableName('catalog_product_entity');
8990

9091
$specialPrice = $this->resource->getConnection()->select()
91-
->from(['parent' => 'catalog_product_entity'], '')
92+
->from(['parent' => $productTable], '')
9293
->joinInner(
9394
['link' => $this->resource->getTableName('catalog_product_relation')],
9495
"link.parent_id = parent.$linkField",
9596
[]
9697
)->joinInner(
97-
['child' => 'catalog_product_entity'],
98+
['child' => $productTable],
9899
"child.entity_id = link.child_id",
99100
['entity_id']
100101
)->joinInner(

app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,16 @@ public function __construct(
6868
public function build($productId)
6969
{
7070
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
71+
$productTable = $this->resource->getTableName('catalog_product_entity');
72+
7173
$priceSelect = $this->resource->getConnection()->select()
72-
->from(['parent' => 'catalog_product_entity'], '')
74+
->from(['parent' => $productTable], '')
7375
->joinInner(
7476
['link' => $this->resource->getTableName('catalog_product_relation')],
7577
"link.parent_id = parent.$linkField",
7678
[]
7779
)->joinInner(
78-
['child' => 'catalog_product_entity'],
80+
['child' => $productTable],
7981
"child.entity_id = link.child_id",
8082
['entity_id']
8183
)->joinInner(

app/code/Magento/CatalogRule/Model/ResourceModel/Product/LinkedProductSelectBuilderByCatalogRulePrice.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,16 @@ public function build($productId)
7474
$timestamp = $this->localeDate->scopeTimeStamp($this->storeManager->getStore());
7575
$currentDate = $this->dateTime->formatDate($timestamp, false);
7676
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
77+
$productTable = $this->resource->getTableName('catalog_product_entity');
7778

7879
return [$this->resource->getConnection()->select()
79-
->from(['parent' => 'catalog_product_entity'], '')
80+
->from(['parent' => $productTable], '')
8081
->joinInner(
8182
['link' => $this->resource->getTableName('catalog_product_relation')],
8283
"link.parent_id = parent.$linkField",
8384
[]
8485
)->joinInner(
85-
['child' => 'catalog_product_entity'],
86+
['child' => $productTable],
8687
"child.entity_id = link.child_id",
8788
['entity_id']
8889
)->joinInner(

0 commit comments

Comments
 (0)