Indexing Issue with M2 CE after 2.3.3 upgrade

Hello. First technial issue with Magento that I don’t know why. Upgraded Magento to 2.3.3 yesterday, and when I’m trying to reindex, Magento can’t index ‘Catalog Search’ and gives the following error:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Catalog\Model\ResourceModel\Product\Collection::addIsSaleableAttributeToFilter() must be of t he type array or null, integer given, called in /home/325194.cloudwaysapps.com/xnjyrekmqf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/ Collection.php on line 1582 and defined in /home/325194.cloudwaysapps.com/xnjyre kmqf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:2475
Stack trace:
#0 /home/325194.cloudwaysapps.com/xnjyrekmqf/public_html/vendor/magento/module-c atalog/Model/ResourceModel/Product/Collection.php(1582): Magento\Catalog\Model\R esourceModel\Product\Collection->addIsSaleableAttributeToFilter(1)
#1 /home/325194.cloudwaysapps.com/xnjyrekmqf/public_html/generated/code/Magento/ Catalog/Model/ResourceModel/Product/Collection/Interceptor.php(518): Magento\Cat alog\Model\ResourceModel\Product\Collection->addAttributeToFilter(‘is_saleable’, 1, ‘left’)
#2 /home/325194.cloudwaysapps.com/xnjyrekmqf/public_htm in /home/325194.cloudway sapps.com/xnjyrekmqf/public_html/vendor/magento/module-catalog/Model/ResourceMod el/Product/Collection.php on line 2475

Anyone know why, and how to resolve it?
Thanks in advance.

I’ve never had this issue before. However, it’s entirely possible that this index is crashing due to your PHP memory_limit. Especially, if you haven’t changed anything other than upgrading Magento.

After upgrading Magento, the .htaccess file gets “reset” back to:

<IfModule mod_php7.c>
############################################
## adjust memory limit

    php_value memory_limit 756M
    php_value max_execution_time 18000

Try changing this back to to 2G:

php_value memory_limit 2G

Alternatively, if this does not help then you may be one of the first to have discovered a genuine bug in 2.3.3 that you should report to Magento here.

1 Like

Hi,

Please try setup:upgrade on your public_html directory.

php bin/magento setup:upgrade

Kind regards,

Thomas

Thanks Craig and Thomas. It turned out to be a compatibility between M2.3.3 and our theme (Porto). The Porto developers have issued a patch which resolves this issue.

Ian

Hi @rocketman you can explain what files are patched by porto ?¿?

Porto its a very ver bad Support and every update breaks my website.

Hello. If you download the latest version of Porto, there’s a patch for 2.3.3, I can’t remember what the files were that were changed, but it is just a case of uploading the patch files, running the php bin/magento setup:upgrade command in your Magento directory and reindexing and it’s solved.

Hello, I am Facing the same issue with porto theme. i am upgrading magento 2.1 to 2.3.3.
please explain me the solution.
I am getting the same error

**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/lifestylestoreco/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 1582 and defined in /home/lifestylestoreco/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:2475
Stack trace:
#0 /home/lifestylestoreco/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php(1582): Magento\Catalog\Model\ResourceModel\Product\Collection->addIsSaleableAttributeToFilter(1)
#1 /home/lifestylestoreco/public_html/generated/code/Magento/Catalog/Model/ResourceModel/Product/Collection/Interceptor.php(518): Magento\Catalog\Model\ResourceModel\Product\Collection->addAttributeToFilter('is_saleable', 1, 'left')
#2 /home/lifestylestoreco/public_html/app/code/Smartwave/Porto/Helper/Data.php(143): Magento\Catalog\Model\ResourceModel\Product\Co in  **/home/lifestylestoreco/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php**  on line  **2475**

Thanks in advance.

Please share the solution.

I believe he simply uploaded the patch that comes with the Porto Theme. If you redownload the theme from Themeforest, it will contain any new patches that you can then manually install.

1 Like

Correct Craig, I’ve marked my message 3 messages up as the solution.

1 Like

This is the easiest way to fix the issue… extract the same patch file to file manager… solved. Thanks

can any one share the pach file i m also facing the same issue .

Hi @Vertigo_Go and welcome.

The Porto Theme Patches are included in the Themeforest zip file. Just log back into Themeforest and re-download the theme. Once you’ve downloaded the theme, you’ll find everything you need inside: Theme Files > Magento 2.x.