1

After Upgrade Magento latest version problem is showing under custom module.

pc-114@pc114-desktop:/var/www/html/gossip$ sudo bin/magento setup:di:compile
Compilation was started.
Area configuration aggregation... 5/9 [===============>------------]  55% 21 secs 312.0 MiB
In ClassReader.php line 57:

Impossible to process constructor argument Parameter #6 [ <required> Magento\Framework\Search\Adapter\Mysql\Mapper $mapper ] of Manadev\ProductCollection\Resources\Filters\SearchFilterResource class

In GetParameterClassTrait.php line 34:

Class "Magento\Framework\Search\Adapter\Mysql\Mapper" does not exist

setup:di:compile

  • this class is delete in magento 2.4. Error comes because you have used this class in di – Mehran Dec 28 '22 at 07:00
  • php bin/magento dev:di:info "Magento\Framework\Search\Adapter\Mysql\Mapper" to see where it is used and remove the class from there – Mehran Dec 28 '22 at 07:02
  • it's showing

    There are no commands defined in the "dev:di" namespace.

    Did you mean this?
    setup:di

    – Aashutosh Kumar Dec 28 '22 at 07:10
  • check this https://magento.stackexchange.com/questions/319437/magento-2-4-class-magento-framework-search-adapter-mysql-mapper-does-not-exist – Mehran Dec 28 '22 at 07:22

2 Answers2

0

Run this command on you root

grep -r "Magento\Framework\Search\Adapter\Mysql\Mapper" app/

It will show you the file name where you override this class.

Just Disable/Remove those overrides from the di.xml (Any preference/virtual classes/plugin) and also delete those overrides PHP file as well otherwise whenever setup:di:compile runs same error will come.

Arun Sharma
  • 1,315
  • 1
  • 9
  • 33
0

Your issue was caused by Manadev Multiple Select Layered Navigation (Filters) extension, your current extension version is not compatible with Magento 2.4 due to Magento\Framework\Search\Adapter\Mysql\Mapper $mapper was removed since Magento 2.4

So, there are some approaches for you:

  1. Upgrade Manadev Multiple Select Layered Navigation (Filters) extension to the latest version to check if it resolves your issue.
  2. If solution 1 does not work, you have to investigate Manadev extension to fix the issue.
    Hints: Constructor argument Parameter number #6 in Manadev\ProductCollection\Resources\Filters\SearchFilterResource class required Magento\Framework\Search\Adapter\Mysql\Mapper but Magento\Framework\Search\Adapter\Mysql\Mapper class does not exist (removed) in Magento 2.4
    Run this command to find the file path of Manadev\ProductCollection\Resources\Filters\SearchFilterResource class:
    grep -r --include \*.php "Magento\\\Framework\\\Search\\\Adapter\\\Mysql\\\Mapper $mapper" app vendor
  3. If you don't have time or do not ready to fix Manadev extension, you should disable it.
Tu Van
  • 6,868
  • 2
  • 11
  • 22