Skip to content

Commit 73d221c

Browse files
committed
MAGETWO-74021: "Catalog Products List" widget does not displays on frontend
1 parent 2d73f74 commit 73d221c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,14 +1060,15 @@ public function getAllAttributeValues($attribute)
10601060
$select = clone $this->getSelect();
10611061
$attribute = $this->getEntity()->getAttribute($attribute);
10621062

1063-
$aiField = $this->getConnection()->getAutoIncrementField($this->getMainTable());
1063+
$fieldMainTable = $this->getConnection()->getAutoIncrementField($this->getMainTable());
1064+
$fieldJoinTable = $attribute->getEntity()->getLinkField();
10641065
$select->reset()
10651066
->from(
10661067
['cpe' => $this->getMainTable()],
10671068
['entity_id']
10681069
)->join(
10691070
['cpa' => $attribute->getBackend()->getTable()],
1070-
'cpe.' . $aiField . ' = cpa.' . $aiField,
1071+
'cpe.' . $fieldMainTable . ' = cpa.' . $fieldJoinTable,
10711072
['store_id', 'value']
10721073
)->where('attribute_id = ?', (int)$attribute->getId());
10731074

dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ public function testCreateCollectionWithDropdownAttributeStoreScope()
115115
. $dropdownAttributeOptionIds[1] . '`^]^]';
116116
$this->block->setData('conditions_encoded', $encodedConditions);
117117
$this->performAssertions(2);
118+
$attribute->setUsedInProductListing(0);
119+
$attribute->save();
120+
$this->performAssertions(2);
118121
}
119122

120123
/**

0 commit comments

Comments
 (0)