Array Filter Error – Fixing array_filter() Expects Parameter 1 to be Array in Magento 2

errormagento2

I am getting this warning when im trying to add a product:

Warning: array_filter() expects parameter 1 to be array, string given in 

/html/vendor/magento/module-configurable-product/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php on line 145

this is the code:

    }
  $extensionAttributes>setConfigurableProductLinks(array_filter($associatedProductIds));
    }

I dont understand why.
enter image description here

Best Answer

I Found Solution after R&D On Magento database.
Login In your phpmyadmin
Go to your website database
Open "eav_attribute" table
Find Your multiselect "attribute_id"
Edit Row
If "backend_model" Column blank then paste this Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend

enter image description here

Related Topic