InsideDarkWeb.com

reindex command generates error: Argument 2 passed to MagentoCatalogBlockProductImageFactory::getLabel()

When I run reindex command bin/magento index:reindex catalog_data_exporter_categories
I get the following error on console.

Argument 2 passed to MagentoCatalogBlockProductImageFactory::getLabel()

Kindly find the attached image.

enter image description here

I referred this LINK, but I didn’t got any solution.

Kindly guide me if anyone faced this issue.

Thanks in advance

Magento Asked on February 16, 2021

1 Answers

One Answer

Hey chris, hope you are doing well.

This is the issue related to theme. try this,

$collection = $this->_objectManager->create('MagentoCatalogModelResourceModelProductCollection');


$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:)

Answered by Munesh Jalwani on February 16, 2021

Add your own answers!

Related Questions

is creating block within template in magento 2 good practice

0  Asked on July 24, 2020 by herve-tribouilloy

       

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.