Skip to content

[Modularity] Layered navigation may be broken if CatalogSearch is disabled  #30307

Open
@magento-engcom-team

Description

@magento-engcom-team

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: CatalogComponent: CatalogSearchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.3.3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions