cancel
Showing results for 
Search instead for 
Did you mean: 

Error after indexing after upgrade to 2.3.3

SOLVED

Error after indexing after upgrade to 2.3.3

Hi. I've just tried reindexing my Magento after upgrading to 2.3.3 last night, and it's giving me the following error after indexing:

 

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/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/xnjyrekmqf/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-catalog/Model/ResourceModel/Product/Collection.php(1582): Magento\Catalog\Model\ResourceModel\Product\Collection->addIsSaleableAttributeToFilter(1)
#1 /home/325194.cloudwaysapps.com/xnjyrekmqf/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/325194.cloudwaysapps.com/xnjyrekmqf/public_htm in /home/325194.cloudwaysapps.com/xnjyrekmqf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 2475

Does anyone know why and what it is?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: 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!

 

Edit

Looking further into this, my current theme is using

 

$collection = $this->_objectManager->create('\Magento\Catalog\Model\ResourceModel\Product\Collection');
...
...
$collection->addAttributeToFilter('is_saleable', 1, 'left')
...

 

The method addAttributeToFilter() is expecting the 2nd parameter $condition to be an array or null, but the theme obviously hasn't been updated. I've changed it from

$collection->addAttributeToFilter('is_saleable', 1, 'left')

to...  note 1 -> [1]

 

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

This works and I'll feed it back to the theme developer. Suggest you look at the error you're getting...

#1 /home/325194.cloudwaysapps.com/xnjyrekmqf/public_html/generated/code/Magento/Catalog/Model/ResourceModel/Product/Collection/Interceptor.php(518): Magento\Catalog\Model\ResourceModel\Product\Collection->addAttributeToFilter('is_saleable', 1, 'left')

The error is coming from the generate folder, have you done a setup:di:compile since upgrading?

View solution in original post

9 REPLIES 9

Re: Error after indexing after upgrade to 2.3.3

OK. This error appears when Magento is trying to reindex 'Catalog Search', which it can't do.

Don't know what has changed, as have never had this error before.

Re: 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!

 

Edit

Looking further into this, my current theme is using

 

$collection = $this->_objectManager->create('\Magento\Catalog\Model\ResourceModel\Product\Collection');
...
...
$collection->addAttributeToFilter('is_saleable', 1, 'left')
...

 

The method addAttributeToFilter() is expecting the 2nd parameter $condition to be an array or null, but the theme obviously hasn't been updated. I've changed it from

$collection->addAttributeToFilter('is_saleable', 1, 'left')

to...  note 1 -> [1]

 

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

This works and I'll feed it back to the theme developer. Suggest you look at the error you're getting...

#1 /home/325194.cloudwaysapps.com/xnjyrekmqf/public_html/generated/code/Magento/Catalog/Model/ResourceModel/Product/Collection/Interceptor.php(518): Magento\Catalog\Model\ResourceModel\Product\Collection->addAttributeToFilter('is_saleable', 1, 'left')

The error is coming from the generate folder, have you done a setup:di:compile since upgrading?

Re: Error after indexing after upgrade to 2.3.3

what file did you change? Can you provide a path?

Re: Error after indexing after upgrade to 2.3.3

In our case it was a compatibility issue with the Porto theme we use. There was a patch issued by them that resolved the issue.

Re: Error after indexing after upgrade to 2.3.3

can you give reference to that patch?

Re: Error after indexing after upgrade to 2.3.3

Download Porto from your account and it's the patch inside for 2.3.3.

Re: Error after indexing after upgrade to 2.3.3

I am facing the same issue. Please provide a path in which file did you change.

Re: Error after indexing after upgrade to 2.3.3

How did you resolve this issue?

Re: Error after indexing after upgrade to 2.3.3


@chintan_ramani wrote:

How did you resolve this issue?


Literally 2 posts up the guy told you Porto now includes a specific 2.3.3 patch to resolve this problem.

 

As a person who also experienced this I can confirm the patch works.