How to fix incompatible issue with M2.4.0?

Created by Jane D, Modified on Fri, 05 Mar 2021 at 11:09 AM by Jane D

QUESTION:

I installed the module version 2.2.6 on Magento 2.4, the command bin/magento setup:di:compile shows: 

Fatal error:  Uncaught Error: Class 'Magento\CatalogSearch\Model\Search\FilterMapper\ExclusionStrategy' not found in /app/code/Bss/MultiStoreViewPricing/Model/Search/FilterMapper/ExclusionStrategy.php:26

Can you tell me how to fix it?


ANSWER:

The issue due to the fact that the module is not compatible with Magento 2.4 


The solution as below:


Step 1: Plese remove code    <preference for="Magento\CatalogSearch\Model\Search\FilterMapper\ExclusionStrategy" type="Bss\MultiStoreViewPricing\Model\Search\FilterMapper\ExclusionStrategy" /> in file app/code/Bss/MultiStoreViewPricing/etc/frontend/di.xml


Step 2:  Remove file
app/code/Bss/MultiStoreViewPricing/Model/Search/FilterMapper/ExclusionStrategy.php


After the fix above, there is another error shown:


Fatal error:  Uncaught Error: Class 'Magento\CatalogSearch\Model\Adapter\Mysql\Dynamic\DataProvider' not found in app/code/Bss/MultiStoreViewPricing/Model/CatalogSearch/Adapter/Mysql/Dynamic/DataProvider.php:34
Stack trace:
#0 /var/www/xxx/xxxx/xxxx/vendor/composer/ClassLoader.php(444): include()
#1 /var/www/xxx/xxx/xxxxx/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/vhosts...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Bss\\MultiStoreV...')
#3 [internal function]: spl_autoload_call('Bss\\MultiStoreV...')
#4 /var/www/xxxx/xxxx/xxxx/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists('Bss\\MultiStoreV...')
#5 /var/www/xxxxx/xxxx/xxxxx/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass('Bss\\MultiStoreV...', '/var/www/vhosts...')
#6 /var/www/vhosts in /var/www/xxxx/xxxxx/xxxx/app/code/Bss/MultiStoreViewPricing/Model/CatalogSearch/Adapter/Mysql/Dynamic/DataProvider.php on line 34


Step 3: Please remove code:
<preference for="Magento\Framework\Search\Dynamic\DataProviderInterface" type="Bss\MultiStoreViewPricing\Model\CatalogSearch\Adapter\Mysql\Dynamic\DataProvider" />
in file app/code/Bss/MultiStoreViewPricing/etc/di.xml.

Step 4: Remove file
app/code/Bss/MultiStoreViewPricing/Model/CatalogSearch/Adapter/Mysql/Dynamic/DataProvider.php


If you have any other question or concern, please feel free to leave us a message via https://bsscommerce.com/contact

We'd be happy to support.





Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us how can we improve this article!

Select atleast one of the reasons

Feedback sent

We apprciate your effort and will try to fix the article