Description
Steps to reproduce:
- Install Magento with disabled CatalogSearch module
- Open category page and use layered navigation
Actual result:
(x) Layered navigation will contain bugs that have already been fixed, and would not be reproducible with installed CatalogSearch (e.g. this one MAGETWO-63175)
Expected result:
(/) Layered navigation should work correctly with or without CatalogSearch installed
Additional details:
There is hidden modularity issue between Catalog and CatalogSearch.
\Magento\Catalog\Model\Layer\FilterList
has a list of default filters declared as private variable:
protected $filterTypes = <
self::CATEGORY_FILTER => \Magento\Catalog\Model\Layer\Filter\Category::class,
self::ATTRIBUTE_FILTER => \Magento\Catalog\Model\Layer\Filter\Attribute::class,
self::PRICE_FILTER => \Magento\Catalog\Model\Layer\Filter\Price::class,
self::DECIMAL_FILTER => \Magento\Catalog\Model\Layer\Filter\Decimal::class,
>;
{code}
Then in constructor these filters are overridden by the ones specified in `di.xml` by other modules:
{code:php}
/*** Override default filter type models **/
$this->filterTypes = array_merge($this->filterTypes, $filters);
CatalogSearch overrides all filters declared in Catalog module. So with installed CatalogSearch all default filters are overridden and this is setup we are always testing. If CatalogSearch is disabled - we fall back to the filters which we never test and those filters contain bugs, which have been fixed in CatalogSearch.