0

enter image description here

I tried to update the product using REST API but it shows the page this like i can't recognise the error please any one help to resolve it. Header : rest/all/V1/products/SKU My API :

{
   "product":{
      "id":10,
      "sku":"SKU",
      "name":"My product name",
      "attribute_set_id":4,
      "status":1,
      "visibility":4,
      "type_id":"simple",
      "weight":"0.0",
      "extension_attributes":{
         "category_links":[
            {
               "position":0,
               "category_id":"99",
               "extension_attributes":{



               }
            }
         ],
         "stock_item":{
            "qty":"0",
            "is_in_stock":true,
            "extension_attributes":{



            }
         }
      },
      "custom_attributes":[

         {
            "attribute_code":"manufacturer",
            "value":"5824"
         }
      ]
   }
}

I find the line in UI DataProvide ( vendor\magento\module-catalog\Ui\DataProvider\Product\ProductDataProvider.php )

$this->getCollection()->toArray()

Thanks in Advance :)

| improve this question | | | | |
0

if you are using docker try

dockergento magento c:f

if not try

php bin/magento c:f

about error try if (!isset ... ->toArray()) or try removing toArray at all.

| improve this answer | | | | |

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.