chillermiller Posted January 16, 2016 Share Posted January 16, 2016 Hello everyone, i openend the shop xml files typing in my browser http://localhost/api/. I can access the customers section, but i cannot access the products or categories section.When i activate the debug mode in config/defines.inc.php the following error message comes up: Fatal error: Uncaught Error: Function name must be a string in C:\xampp\htdocs\classes\webservice\WebserviceOutputBuilder.php:542 Stack trace: #0 C:\xampp\htdocs\classes\webservice\WebserviceOutputBuilder.php(481): WebserviceOutputBuilderCore->renderField(Object(Product), Array, 'id_default_imag...', Array, 0) #1 C:\xampp\htdocs\classes\webservice\WebserviceOutputBuilder.php(385): WebserviceOutputBuilderCore->renderEntity(Object(Product), 0) #2 C:\xampp\htdocs\classes\webservice\WebserviceRequest.php(1694): WebserviceOutputBuilderCore->getContent(Array, NULL, 'full', 0, 2) #3 C:\xampp\htdocs\classes\webservice\WebserviceRequest.php(560): WebserviceRequestCore->returnOutput() #4 C:\xampp\htdocs\webservice\dispatcher.php(87): WebserviceRequestCore->fetch('E1UP4CKKTLKNZ2N...', 'GET', 'products/2', Array, false, NULL) #5 {main} thrown in C:\xampp\htdocs\classes\webservice\WebserviceOutputBuilder.php on line 542 I admit that i just changed the supported versions on line 49 in PSWebServiceLibrary.php to const psCompatibleVersionsMax = '1.6.1.4'; because that is my current version. Some tries accessing the webservice with a token in php resulted in the same error code. How can I fix this problem? May I downgrade to 1.6.1.3? Kind regards, Chris Link to comment Share on other sites More sharing options...
chillermiller Posted January 16, 2016 Author Share Posted January 16, 2016 Problem resolved by downgrading to 1.6.1.3. Link to comment Share on other sites More sharing options...
Laeti-laeti Posted January 19, 2016 Share Posted January 19, 2016 Hi, I am in the same situation. Well, I may as well downgrade too then... It's a shame Thanks for sharing Link to comment Share on other sites More sharing options...
sennevb Posted March 3, 2016 Share Posted March 3, 2016 same error here, someone found a solution too, except downgrading?? Link to comment Share on other sites More sharing options...
ziostanko Posted March 4, 2016 Share Posted March 4, 2016 Same error here with 1.6.1.4 does anyone fixed it? i don't want to downgrade... Link to comment Share on other sites More sharing options...
ziostanko Posted March 4, 2016 Share Posted March 4, 2016 i have this error only with php 7.0.3 if i switch to php 5.5.9 work good 1 Link to comment Share on other sites More sharing options...
maewCP Posted March 31, 2016 Share Posted March 31, 2016 (edited) According to https://github.com/PrestaShop/PrestaShop/pull/5161 in /classes/webservice/WebserviceOutputBuilder.php change line 542 from this $field['value'] = $object->$field['getter'](); to this $field['value'] = $object->{$field['getter']}(); Edited March 31, 2016 by maewCP (see edit history) Link to comment Share on other sites More sharing options...
ziostanko Posted May 10, 2016 Share Posted May 10, 2016 That solve the issue with get requests... When i perform add i get this: Array to string conversion (....httpdocs/classes/webservice/WebserviceRequest.php, line 1431) and you can solve it changing line 1431 to: $object->{$fieldProperties['setter']}((string)$attributes->$fieldName); according to https://github.com/PrestaShop/PrestaShop/blob/a2359f6f753d814311b98e1d273f0262659c5e43/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