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

Avoid warning in WebServiceRequest #11228

Merged
merged 1 commit into from Nov 6, 2018

Conversation

Projects
None yet
8 participants
@AJenbo

AJenbo commented Nov 1, 2018

line 800 assumes that self::$shopIDs is an array that can be counted.
But self::$shopIDs is null and the following error appears:
[PHP Warning #2] count(): Parameter must be an array or an object that implements Countable (/home/jojo/public_html/mydomain.com/presta2/classes/webservice/WebserviceRequest.php, line 800)

Questions Answers
Branch? 1.7.4.x
Description? This issue affects any one running PS on PHP 7.2.x with with display_error=on.
Type? bug fix
Category? BO
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #11227
How to test? Enable WS and visit /api

This change is Reviewable

Fix Error 500 from API request with PHP 7.2
line 800 assumes that self::$shopIDs is an array that can be counted.
But self::$shopIDs is null and the following error appears:
[PHP Warning #2] count(): Parameter must be an array or an object that implements Countable (/home/jojo/public_html/mydomain.com/presta2/classes/webservice/WebserviceRequest.php, line 800)
@prestonBot

This comment has been minimized.

Collaborator

prestonBot commented Nov 1, 2018

Hello @AJenbo!

This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community!

@khouloudbelguith

This comment has been minimized.

Contributor

khouloudbelguith commented Nov 2, 2018

Fixed in the 1.7.5.0 by this PR: #9439

@AJenbo

This comment has been minimized.

AJenbo commented Nov 2, 2018

@khouloudbelguith this is a simple cherry pick from that PR for the 1.7.4.x branch since the WS is completely broken for a large amount of users due to this issue. Since 1.7.5.x is not out of beta yet I think it would make sens to still provide patches for sever bugs?

@Quetzacoalt91

This comment has been minimized.

Member

Quetzacoalt91 commented Nov 2, 2018

Hi @AJenbo,

Your point makes sense, unfortunately we only accept security fixes or regression from 1.7.4.0 on this branch to be focused on the 1.7.5.0 version, as described here: https://devdocs.prestashop.com/1.7/contribute/contribution-guidelines/#target-branch

The fix will be available in the next minor release, with a beta coming shortly. It will be in consequence available for everybody ready to upgrade.

Closing as it won't be merged on this branch, thanks for your understanding.

@jolelievre

thank you @AJenbo

@jolelievre jolelievre changed the title from WS: Fix Error 500 from API request with PHP 7.2 to Avoid warning in WebServiceRequest Nov 6, 2018

@jolelievre jolelievre merged commit 25105ac into PrestaShop:1.7.4.x Nov 6, 2018

2 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@AJenbo AJenbo deleted the Cobiro:1.7.4.x branch Nov 6, 2018

@AJenbo

This comment has been minimized.

AJenbo commented Nov 6, 2018

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment