Skip to content

Commit 8cce049

Browse files
MAGETWO-69130: Non effective query for catalog search & layered navigation
1 parent bc287ff commit 8cce049

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

app/code/Magento/CatalogSearch/Model/Search/FilterMapper/VisibilityFilter.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ private function applyFilterByWhere(FilterInterface $filter, Select $select)
185185
*
186186
* @return int
187187
* @throws \Magento\Framework\Exception\LocalizedException
188-
* @throws \InvalidArgumentException
189188
*/
190189
private function getVisibilityAttributeId()
191190
{
@@ -194,10 +193,6 @@ private function getVisibilityAttributeId()
194193
self::VISIBILITY_FILTER_FIELD
195194
);
196195

197-
if ($attr === null) {
198-
throw new \InvalidArgumentException('Wrong code for visibility attribute');
199-
}
200-
201196
return (int) $attr->getId();
202197
}
203198

dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/VisibilityFilterTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,6 @@ public function testApplyWithWrongType()
6767
$this->visibilityFilter->apply($select, $filter, 'Luke, I am your father!');
6868
}
6969

70-
/**
71-
* @expectedException InvalidArgumentException
72-
* @expectedExceptionMessage Wrong code for visibility attribute
73-
*/
74-
public function testApplyWithWrongAttributeCode()
75-
{
76-
$select = $this->resource->getConnection()->select();
77-
$filter = $this->mockFilter();
78-
79-
$this->eavConfigMock
80-
->method('getAttribute')
81-
->willReturn(null);
82-
83-
$this->visibilityFilter->apply($select, $filter, VisibilityFilter::FILTER_BY_WHERE);
84-
}
85-
8670
public function testApplyFilterAsWhere()
8771
{
8872
$select = $this->resource->getConnection()->select();

0 commit comments

Comments
 (0)