Mohit Chandra Posted November 14, 2014 Share Posted November 14, 2014 Hello, I had been struggling while creating products on pretsashop 1.6.0.9, via web-services. The error i`m getting are - Error 1 - Undefined index: (/var/www/prestashop/1609/classes/Product.php, line 4879) Error 2 - [php Warning #2] array_splice() expects parameter 2 to be long, string given (/var/www/prestashop/1609/classes/Product.php, line 4881) I thought the problem is in the way we are doing to create the products, but when i deeply check the problem and look inside some Core files of prestashop version 1.6.0.9. I found these above issue(s), which when fixed by me obvious, everything is worked like a charm for me Now, I want to share it with all of you. May be it will help someone like me n save his/her time, I`lso want this forum to except it as a patch to this version. Here is the fix - Fix for Error 1 - File name - Product.php Line number - line 4846 class name - getWsPositionInCategory() Replace return 0; in place of return ''; Fix to Error 2 - File name - Product.php Line number - line 4881 class name - setWsPositionInCategory() Replace "array_splice($result, (int)$position, 0, $save);" in place of "array_splice($result,$position, 0, $save);" That`s it... Link to comment Share on other sites More sharing options...
pakuize Posted December 30, 2014 Share Posted December 30, 2014 Thank you so much. You just saved me a good amount of time debugging, as I was certain that it was my code that had a bug and not prestashop. Link to comment Share on other sites More sharing options...
Recommended Posts