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

2
  • 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, 2018 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. May 3, 2018 at 13:26

2 Answers 2

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

8
  • Yes I have value in that column as above screenshot, still my value not getting saved. Feb 1, 2019 at 6:15
  • magento version? Feb 1, 2019 at 6:29
  • 1
    working on 2.3.0 @Jugal Feb 1, 2019 at 6:47
  • solution only for Magento version 2.2.X! Not Idea for solution in 2.3.0! i will check in 2.3 for this Feb 1, 2019 at 6:56
  • Yes please, @Jugal, That will be a great help!! here is my ticket magento.stackexchange.com/questions/260079/… Feb 1, 2019 at 6:57
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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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