Magento – Fatal error: Uncaught Error: Call to undefined method addAttributeToSelect()

customermagento2

After deleted custom attribute and getting

Fatal error: Uncaught Error: Call to undefined method
Magento\Customer\Model\Indexer\Source::addAttributeToSelect() in
/vendor/magento/framework/Indexer/Handler/AttributeHandler.php on line
38

Is this bug in Magento 2.2.3? (https://github.com/magento/magento2/issues/10838)

Best Answer

This issue is incredible because It is the result of a fake configuration of the file:

module-customer/etc/indexer.xml

In fact the bug is the line 14:

<fieldset name="customer" source="Magento\Customer\Model\Indexer\Source"

must be changed in

<fieldset name="customer" source="Magento\Customer\Model\ResourceModel\Customer\Collection"

So the problem is solved.