A 500 error response occurs when invoking the WebService Get request for any product, for example api/products/724.
<br />
<b>Notice</b>: Undefined offset: 1 in <b> public_html/webservice/dispatcher.php</b> on line <b>39</b><br />
Fatal error: Uncaught Error: Function name must be a string in public_html/classes/WebserviceOutputBuilder.php:527
Stack trace:
#0 public_html/classes/WebserviceOutputBuilder.php(470): WebserviceOutputBuilderCore->renderField(Object(Product), Array, 'id_default_imag...', Array, 0)
#1 public_html/classes/WebserviceOutputBuilder.php(381): WebserviceOutputBuilderCore->renderEntity(Object(Product), 0)
#2 public_html/classes/webservice/WebserviceRequest.php(1855): WebserviceOutputBuilderCore->getContent(Array, NULL, 'full', 0, 2)
#3 public_html/classes/webservice/WebserviceRequest.php(628): WebserviceRequestCore->returnOutput()
#4 public_html/webservice/dispatcher.php(89): WebserviceRequestCore->fetch('KEYKEYKEYKEYKEYKEY...', 'GET', 'products/724', Array, false, NULL)
#5 {main}
thrown in public_html/classes/WebserviceOutputBuilder.php on line 527
The issue most probably is either data/configuration specific to my setup, since the shop has upgraded multiple times since 1.4.x that I started using prestashop.
WebService is enabled with a token that has access to products. This was working on 1.6.x but stopped after upgrading to 1.7.x
The WebService is responsive to other endpoints, when triggering for example api/products/ without specifying an id, a list with all the products is returned on a 200 Ok response.
Any help or advice will be greatly appreciated.
A 200 Ok respond containing the product information
Steps to reproduce the behavior:
Hello @thdouk
I didn't manage to reproduce your issue with PS1.7.6.8, see the attached screen record below:
https://drive.google.com/file/d/1hiUMKRuh2f3rTOEJOVOjjpK6Cm2zwDhF/view
Could you please provide more infos, like is there any errors launched while upgrading your store.
Thanks!
No errors occurred during the upgrade, I checked the autoupgrade/tmp/log.txt as well to verify.
It seems that this is data specific, which is bad news.
What would cause this error? How can I address an issue of such? Can I validate somehow that the data stored are correct or could you point me to where the data are being queried to investigate further?
How would you suggest troubleshooting this? I have good technical background but lacking php skill :(
Hello @thdouk ,
We use GitHub issues only to discuss about bugs and new features in the PrestaShop project. If you have questions about using PrestaShop or third-party modules, or if you need help with your shop, please consider one of our support plans.
Alternatively, you can also ask for help in the community forums or in the public Slack channel.
Thanks!
Thanks for having a look anyway :)