Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Notice Error while accessing API on /products #28279

Closed
2 tasks done
preoteasa opened this issue Apr 18, 2022 · 10 comments
Closed
2 tasks done

PHP Notice Error while accessing API on /products #28279

preoteasa opened this issue Apr 18, 2022 · 10 comments
Labels
1.7.8.5 Affects versions Bug Type: Bug Duplicate Resolution: issue closed because already reported Invalid Resolution: issue closed because invalid Old Products Page Concerns the old product page Webservice Label: Which BO under menu is concerned WS Category: Web Service

Comments

@preoteasa
Copy link
Contributor

Prerequisites

Describe the bug and add screenshots

This error has bee previously reported for version 1.7.7 beta. The resolution was then that version 1.7.7 is not compatible with php 7.4. However, Prestashop 1.7.8 should be compatible with php 7.4.

Expected behavior

No response

Steps to reproduce

  1. load page https://...webservice_address.../api/products?schema=blank
  2. The result contains the error mentioned above, plus a similar error for line 719.
    products-response.txt

PrestaShop version(s) where the bug happened

1.7.8.5

PHP version(s) where the bug happened

7.4.3

If your bug is related to a module, specify its name and its version

No response

@preoteasa preoteasa added Bug Type: Bug New New issue not yet processed by QA labels Apr 18, 2022
@prestonBot prestonBot added the PR available Solution: issue is being addressed label Apr 18, 2022
@florine2623
Copy link
Contributor

Hello @preoteasa ,

PS 1.7.8.x is already compatible with PHP 7.4 : https://devdocs.prestashop.com/1.7/basics/installation/system-requirements/

I'm using PHP 7.4 with PS 1.7.8.5.
I can't reproduce your issue, i do not have any error :
Screenshot 2022-04-19 at 10 01 59

Can you give more info about your issue ?
Thanks!

@florine2623 florine2623 added WS Category: Web Service NMI Status: issue needs more information Webservice Label: Which BO under menu is concerned 1.7.8.x Branch Waiting for author Status: action required, waiting for author feedback and removed New New issue not yet processed by QA labels Apr 19, 2022
@preoteasa
Copy link
Contributor Author

preoteasa commented Apr 19, 2022

Here is a link where you can test the erroneous behavior:

--deleted-- check the video later.

It is a new install of Prestashop 1.7.8.5 on Ubuntu 20.04 LTS, using apache and php 7.4.3, cgi. It is the default installation of php.

$php --version
PHP 7.4.3 (cli) (built: Mar 2 2022 15:36:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

The shop runs on AWS on an ARM processor.

@prestashop-issue-bot prestashop-issue-bot bot removed the Waiting for author Status: action required, waiting for author feedback label Apr 19, 2022
@preoteasa
Copy link
Contributor Author

preoteasa commented Apr 19, 2022

By the way. If you enable debug mode, the error goes away and you get the output from your screen shot. I think that this is a serious problem too. The debug mode should not hide errors.

@florine2623
Copy link
Contributor

@preoteasa ,

I have indeed reproduced your issue with PHP 7.4 on PS 1.7.8.5 (downloaded here)

Screen.Recording.2022-04-19.at.12.06.11.mov
  • With PS 1.7.8.x branch, there's no issue. I tested with PHP 7.3 and PHP 7.4.

  • With PS 1.7.7.8 and PHP 7.4, the error is here too. But that's normal because PS 1.7.7.8 is not compatible with PHP 7.4. With PHP 7.3 it is OK.

  • With develop branch, it works well with PHP 7.4 too.

Screen.Recording.2022-04-19.at.12.28.41.mov

@preoteasa
Copy link
Contributor Author

So you can reproduce the error with 1.7.8.5. What is changed in 1.7.8.x branch? I checked the source code of development branch and it seems similar to 1.7.8.5 release. I could attempt to test the development branch as well. Are you sure the debug is off?

@matks
Copy link
Contributor

matks commented Apr 19, 2022

So you can reproduce the error with 1.7.8.5. What is changed in 1.7.8.x branch?

1.7.8.5...1.7.8.x

https://github.com/PrestaShop/PrestaShop/pulls?q=is%3Apr+milestone%3A1.7.8.6+is%3Amerged

@preoteasa
Copy link
Contributor Author

preoteasa commented Apr 19, 2022

The error occurs also in the development branch of Prestashop. I just cloned the development branch. Here you can see the error:

--deleted-- check the video later

IN ORDER TO REPRODUCE THE ERROR, THE DEBUG MODE MUST BE OFF.

@hibatallahAouadni hibatallahAouadni added 1.7.8.5 Affects versions and removed 1.7.8.x Branch labels Apr 19, 2022
@florine2623 florine2623 changed the title Error api. Operation: products, Message: [PHP Notice #8] Trying to access array offset on value of type null (/var/www/prestashop/classes/webservice/WebserviceOutputBuilder.php, line 716) Error API on /products, Message: [PHP Notice #8] Trying to access array offset on value of type null (/var/www/prestashop/classes/webservice/WebserviceOutputBuilder.php, line 716) Apr 19, 2022
@preoteasa
Copy link
Contributor Author

Here it is a recording that shows the error for the development branch.

New.Recording.-.4_19_2022.8_04_52.PM.mov

I will take down the test installation.

@hibatallahAouadni hibatallahAouadni changed the title Error API on /products, Message: [PHP Notice #8] Trying to access array offset on value of type null (/var/www/prestashop/classes/webservice/WebserviceOutputBuilder.php, line 716) PHP Notice Error while accessing API on /products Apr 20, 2022
@hibatallahAouadni hibatallahAouadni added the Old Products Page Concerns the old product page label Apr 20, 2022
@hibatallahAouadni
Copy link
Contributor

Hello @preoteasa

Thanks for your whole feedback 🙏
We are aware of this issue, it is already in our debug backlog. This issue is a duplicate of #26559.
To be informed when it's fixed, please subscribe to the issue mentioned above.

PS: thanks for the screen record 🙏 I added it to the original issue ☺️

Thanks!

@hibatallahAouadni
Copy link
Contributor

Duplicate of #26559

@hibatallahAouadni hibatallahAouadni marked this as a duplicate of #26559 Apr 20, 2022
@hibatallahAouadni hibatallahAouadni added Duplicate Resolution: issue closed because already reported and removed NMI Status: issue needs more information labels Apr 20, 2022
@hibatallahAouadni hibatallahAouadni added Invalid Resolution: issue closed because invalid and removed PR available Solution: issue is being addressed labels Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.8.5 Affects versions Bug Type: Bug Duplicate Resolution: issue closed because already reported Invalid Resolution: issue closed because invalid Old Products Page Concerns the old product page Webservice Label: Which BO under menu is concerned WS Category: Web Service
Projects
None yet
Development

No branches or pull requests

5 participants