Jump to content
thirty bees forum
  • 0

WebService error in version tb 1.0.8 when accesing /api/products?schema=blank


Question

Posted

Hi,

It's a fresh install, on a centos 7 with MariaDB 10 and PHP 7.1.25.

Any other resources like "/api/categories?schema=blank" returns a correct response, but with products I getting this response:

<?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> <error> <code><![CDATA[3]]></code> <message><![CDATA[[PHP Warning #2] Illegal string offset 'required' (/var/www/html/classes/webservice/WebserviceOutputBuilder.php, line 856)]]></message> </error> </errors> </prestashop>

It seems a bug with the products response. The website is in spanish (from spain)

Can you confirm this?

Thanks!!

3 answers to this question

Recommended Posts

  • 0
Posted

Ok, finally I found the problem.

I'm using PHP 7.1, and in WebserviceOutputBuilder.php line 856, there is: $arrDetails = '';

And it shoud be: $arrDetails = [];

There must be defined as an array, instead of a string. In php 5.x this error would not occur, but in PHP7.x it will generate an error.

Please, mark it as solved and implement this solution for next version. Thanks!!

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...