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

Fix php warning in php 7.2 in case of JSON output #14525

Merged
merged 1 commit into from Jul 11, 2019

Conversation

@202-ecommerce
Copy link
Contributor

commented Jul 8, 2019

Questions Answers
Branch? develop
Description? In case of Json output, $confirmations $informations $errors and $warning are assign as string. PHP 7.2+ : method count() throw a warning when string submitted (https://wiki.php.net/rfc/counting_non_countables).
After that in debug mode, warnings are caught by Symfony or display and JSON will not be valid.
Type? bug fix
Category? BO
BC breaks? no
Deprecations? no
Fixed ticket? no
How to test? We didn't found in the backoffice an ajax request without dieAjax. In an admin controller (or ModuleAdminController) we put a $this->json = true.

This change is Reviewable

Fix php warning in php 7.2 in case of JSON output
In case of Json output, $confirmations $informations $errors and $warning are assign as string.
PHP 7.2 : method `count()` throw a warning when string submitted (https://wiki.php.net/rfc/counting_non_countables).
After that in debug mode, warnings are caught by Symfony.

@202-ecommerce 202-ecommerce requested a review from PrestaShop/prestashop-core-developers as a code owner Jul 8, 2019

@sarahdib sarahdib added QA ✔️ and removed waiting for QA labels Jul 10, 2019

@sarahdib sarahdib added this to the 1.7.7.0 milestone Jul 10, 2019

@mickaelandrieu

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

Thanks @202-ecommerce for the contributions, @PierreRambaud for the review and @sarahdib for the QA approval => LGTM

@mickaelandrieu mickaelandrieu merged commit 92d287a into PrestaShop:develop Jul 11, 2019

2 checks passed

PrettyCI Code formatting
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

mbadrani added a commit to mbadrani/PrestaShop that referenced this pull request Jul 18, 2019

Merge pull request PrestaShop#14525 from 202-ecommerce/patch-7
Fix php warning in php 7.2 in case of JSON output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.