Skip to content

Commit aad59c1

Browse files
committed
MC-32278: Position sort does not work in GraphQl.
- fix search_term
1 parent dfcf474 commit aad59c1

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

app/code/Magento/Eav/Model/Api/SearchCriteria/CollectionProcessor/FilterProcessor.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,18 @@ private function addFilterGroupToCollection(
6565
) {
6666
$fields = [];
6767
foreach ($filterGroup->getFilters() as $filter) {
68-
$isApplied = false;
69-
$customFilter = $this->getCustomFilterForField($filter->getField());
70-
if ($customFilter) {
71-
$isApplied = $customFilter->apply($filter, $collection);
72-
}
68+
if ($filter->getField() != 'search_term') {
69+
$isApplied = false;
70+
$customFilter = $this->getCustomFilterForField($filter->getField());
71+
if ($customFilter) {
72+
$isApplied = $customFilter->apply($filter, $collection);
73+
}
7374

74-
if (!$isApplied) {
75-
$field = $this->getFieldMapping($filter->getField());
76-
$condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
77-
$fields[] = ['attribute' => $field, $condition => $filter->getValue()];
75+
if (!$isApplied) {
76+
$field = $this->getFieldMapping($filter->getField());
77+
$condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
78+
$fields[] = ['attribute' => $field, $condition => $filter->getValue()];
79+
}
7880
}
7981
}
8082

0 commit comments

Comments
 (0)