3

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

  • Use gettype($associatedProductIds) to see if it is indeed a string, and use a vardump to see it's actual content. From there, update your question, because we are going to need a little more information/effort on your part in order to help – mtr.web May 3 '18 at 13:05
  • @amit bera can you please show me how the code should look like so i can copy paste it. im a very beginner at programming. – Almog Lahav May 3 '18 at 13:26
6

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

0

I had this issue when attempting to save a configurable product, and it was due to the sheer amount of individual configurations assigned to the parent product (over 1,600!). Whenever you save a configurable product, it also processes each of these simple products, leading to one large Ajax request (at least 1MB). When I analysed the network information within the browser's Developer Tools, this Ajax call was throwing a 413 "Request Entity Too Large" error.

The solution for me was to adjust the settings on your server to handle larger requests. If you're running Apache, you can add LimitRequestBody 8388608 to the .htaccess file (I think); if you're running Nginx, add client_max_body_size 8M; within the http, server, or location context within the nginx.conf, and then restart the service. These will both increase the maximum size to 8MB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.