0
votes

I am working on a magento project. it was working fine till today.but today when i open it its not working and following error is coming in error log

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Magento\Catalog\Model\ResourceModel\Product\Collection::addIsSaleableAttributeToFilter() must be of the type array or null, integer given, called in /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 1582 and defined in /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:2475

Stack trace:

0 /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php(1582): Magento\Catalog\Model\ResourceModel\Product\Collection->addIsSaleableAttributeToFilter(1)

1 /home/olfwmbaph2hf/public_html/app/code/Smartwave/Filterproducts/Block/Home/LatestList.php(56): Magento\Catalog\Model\ResourceModel\Product\Collection->addAttributeToFilter('is_saleable', 1, 'left')

2 /home/olfwmbaph2hf/public_html/app/code/Smartwave/Filterproducts/Block/Home/LatestList.php(33): Smartwave\Filterproducts\Block\Home\LatestList->getProducts()

3 /home/olfw in /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 2475

can some please help to remove this issue

3

3 Answers

0
votes

Try following solution mentioned here Error after indexing after upgrade to 2.3.3

I am getting this too after upgrading! However, if I change the theme used (Content -> Design -> Config) I can successfully view my site!

Change the 1 (integer) into array
$collection->addAttributeToFilter('is_saleable', 1, 'left')

to this

addAttributeToFilter('is_saleable', [1], 'left')

in in /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 1582

0
votes

This is Porto theme issue with newer version so, better please installed porto theme patch from their support site and install it.

it will fix this issue.

0
votes

you using Porto theme with Magento 2.3.3 you need to update the latest patch follow this link to see more detail Check more detail on this website

Do not edit core files updating this patch will solve your issue !