carbonhoarder Posted June 17, 2016 Share Posted June 17, 2016 (edited) Hello, I recently had to install prestashop on a one.com server; I'm using my own personal app to upload a catalogue on prestashop via the web service. Everything works locally, but on the server I get this error when I try to upload the categories: Fatal error: Uncaught Error: Function name must be a string in /customers/e/5/7/example.it/httpd.www/classes/webservice/WebserviceOutputBuilder.php:542\n Stack trace:\n #0 /customers/e/5/7/example.it/httpd.www/classes/webservice/WebserviceOutputBuilder.php(481): WebserviceOutputBuilderCore->renderField(Object(Category), Array, 'nb_products_rec...', Array, 0)\n #1 /customers/e/5/7/example.it/httpd.www/classes/webservice/WebserviceOutputBuilder.php(385): WebserviceOutputBuilderCore->renderEntity(Object(Category), 0)\n #2 /customers/e/5/7/example.it/httpd.www/classes/webservice/WebserviceRequest.php(1694): WebserviceOutputBuilderCore->getContent(Array, NULL, 'full', 0, 2)\n #3 /customers/e/5/7/example.it/httpd.www/classes/webservice/WebserviceRequest.php(560): WebserviceRequestCore->returnOutput()\n #4 /customers/e/5/7/example.it/httpd.www/webservice/dispatcher.php(87): WebserviceRequestCore->fetch('UPVGHUIN5WVTY4K...', 'POST', 'categories', Array, false, '<?xml version="...')\n #5 {main}\n thrown in /customers/e/5/7/example.it/httpd.www/classes/webservice/WebserviceOutputBuilder.php on line 542\n Interestingly enough, the category does get uploaded, and the response header is 200. But the body of the response is just errors. Does anybody know what the problem could be? Edited June 17, 2016 by carbonhoarder (see edit history) 1 Link to comment Share on other sites More sharing options...
carbonhoarder Posted June 17, 2016 Author Share Posted June 17, 2016 (edited) I guess it's a problem with php7, as soon as I changed to 5.6 the errors disappeared. Edited June 17, 2016 by carbonhoarder (see edit history) 1 Link to comment Share on other sites More sharing options...
mlecoq Posted July 4, 2017 Share Posted July 4, 2017 To support php 7 You have to override WebserviceRequest.php class and to modify this line $object->$fieldProperties['setter']((string)$attributes->$fieldName); into $object->{$fieldProperties['setter']}((string)$attributes->$fieldName); 2 Link to comment Share on other sites More sharing options...
HaCos Posted April 21, 2020 Share Posted April 21, 2020 On 7/4/2017 at 7:50 PM, mlecoq said: To support php 7 You have to override WebserviceRequest.php class and to modify this line $object->$fieldProperties['setter']((string)$attributes->$fieldName); into $object->{$fieldProperties['setter']}((string)$attributes->$fieldName); In order to do this, I have to edit the WebserviceRequest.php in classes/webservice/WebserviceRequest.php ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now