Magento2后端工作正常,但前端不工作,显示此页面不是’;t工作误差

Magento2后端工作正常,但前端不工作,显示此页面不是’;t工作误差,magento,magento2,Magento,Magento2,我正在做一个magento项目。直到今天,它还可以正常工作。但是今天当我打开它时,它不工作,错误日志中出现了以下错误 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

我正在做一个magento项目。直到今天,它还可以正常工作。但是今天当我打开它时,它不工作,错误日志中出现了以下错误

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
堆栈跟踪:

0/home/olfwmbaph2hf/public_html/vendor/magento/module catalog/Model/ResourceModel/Product/Collection.php(1582):magento\catalog\Model\ResourceModel\Product\Collection->addssaleableattributetofilter(1) 1/home/olfwmbaph2hf/public_html/app/code/Smartwave/Filterproducts/Block/home/LatestList.php(56):Magento\Catalog\Model\ResourceModel\Product\Collection->addAttributeToFilter('可销售',1,'左') 2/home/olfwmbaph2hf/public_html/app/code/Smartwave/Filterproducts/Block/home/LatestList.php(33):Smartwave\Filterproducts\Block\home\LatestList->getProducts() 第2475行的3/home/olfwmbaph2hf/public_html/vendor/magento/module catalog/Model/ResourceModel/Product/Collection.php中的/home/olfw
能否请一些人帮助解决此问题

尝试下面提到的解决方案

升级后我也得到了这个!但是,如果我更改使用的主题(内容->设计->配置),我可以成功地查看我的网站

对此

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

在1582行的in/home/olfwmbaph2hf/public_html/vendor/magento/module catalog/Model/ResourceModel/Product/Collection.php中,这是新版本的Porto主题问题,因此,最好从他们的支持站点安装Porto主题补丁并安装它


它将解决此问题。

如果将Porto主题与Magento 2.3.3一起使用,则需要更新最新的修补程序。请按照此链接查看更多详细信息

不要编辑核心文件更新此修补程序将解决您的问题

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