Skip to content

Commit 327d889

Browse files
author
Prabhu Ram
committed
Revert "Merge remote-tracking branch 'origin/MC-21694-bucket' into MC-19226"
This reverts commit bb6f080, reversing changes made to 1a2ae29.
1 parent bb6f080 commit 327d889

File tree

7 files changed

+6
-192
lines changed

7 files changed

+6
-192
lines changed

app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ public function __construct(ResourceConnection $resourceConnection)
4141
* Get option data. Return list of attributes with option data
4242
*
4343
* @param array $optionIds
44-
* @param array $attributeCodes
4544
* @return array
4645
* @throws \Zend_Db_Statement_Exception
4746
*/
48-
public function getOptions(array $optionIds, array $attributeCodes = []): array
47+
public function getOptions(array $optionIds): array
4948
{
5049
if (!$optionIds) {
5150
return [];
@@ -61,28 +60,20 @@ public function getOptions(array $optionIds, array $attributeCodes = []): array
6160
'attribute_label' => 'a.frontend_label',
6261
]
6362
)
64-
->joinLeft(
63+
->joinInner(
6564
['options' => $this->resourceConnection->getTableName('eav_attribute_option')],
6665
'a.attribute_id = options.attribute_id',
6766
[]
6867
)
69-
->joinLeft(
68+
->joinInner(
7069
['option_value' => $this->resourceConnection->getTableName('eav_attribute_option_value')],
7170
'options.option_id = option_value.option_id',
7271
[
7372
'option_label' => 'option_value.value',
7473
'option_id' => 'option_value.option_id',
7574
]
76-
);
77-
78-
$select->where('option_value.option_id IN (?)', $optionIds);
79-
80-
if (!empty($attributeCodes)) {
81-
$select->orWhere(
82-
'a.attribute_code in (?) AND a.frontend_input = \'boolean\'',
83-
$attributeCodes
84-
);
85-
}
75+
)
76+
->where('option_value.option_id IN (?)', $optionIds);
8677

8778
return $this->formatResult($select);
8879
}

app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Attribute.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ private function isBucketEmpty(?BucketInterface $bucket): bool
139139
private function getAttributeOptions(AggregationInterface $aggregation): array
140140
{
141141
$attributeOptionIds = [];
142-
$attributes = [];
143142
foreach ($this->getAttributeBuckets($aggregation) as $bucket) {
144-
$attributes[] = \preg_replace('~_bucket$~', '', $bucket->getName());
145143
$attributeOptionIds[] = \array_map(
146144
function (AggregationValueInterface $value) {
147145
return $value->getValue();
@@ -154,6 +152,6 @@ function (AggregationValueInterface $value) {
154152
return [];
155153
}
156154

157-
return $this->attributeOptionProvider->getOptions(\array_merge(...$attributeOptionIds), $attributes);
155+
return $this->attributeOptionProvider->getOptions(\array_merge(...$attributeOptionIds));
158156
}
159157
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchAggregationsTest.php

Lines changed: 0 additions & 64 deletions
This file was deleted.

dev/tests/integration/testsuite/Magento/Catalog/_files/product_boolean_attribute.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

dev/tests/integration/testsuite/Magento/Catalog/_files/product_boolean_attribute_rollback.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_boolean_attribute.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_boolean_attribute_rollback.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)