Skip to content

General: fix PHP notices that may pop up with PHP 7.4. #14192

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

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

jeherve
Copy link
Member

@jeherve jeherve commented Dec 6, 2019

Changes proposed in this Pull Request:

PHP Notice:  Trying to access array offset on value of type bool in /var/www/html/wp-content/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-react-page.php on line 349
PHP Notice:  Trying to access array offset on value of type bool in /var/www/html/wp-content/plugins/jetpack/src/class-tracking.php on line 95

Testing instructions:

  • Update your Docker container to PHP 7.4 as per Update docker to use PHP 7.4 #13773
  • Connect your site to WordPress.com, and visit a few Jetpack dashboard pages.
  • You should not see any notices in your logs.

Proposed changelog entry for your changes:

  • General: fix PHP warnings that may appear on sites running PHP 7.4.

PHP 7.4 now throws a warning if you try to access a resource as an array, when it is not an array, a string, or an object.
https://wiki.php.net/rfc/notice-for-non-valid-array-container
@jeherve jeherve added this to the 8.1 milestone Dec 6, 2019
@jeherve jeherve requested a review from a team December 6, 2019 16:18
@jeherve jeherve self-assigned this Dec 6, 2019
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello jeherve! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D36380-code before merging this PR. Thank you!

@jetpackbot
Copy link
Collaborator

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: January 14, 2020.
Scheduled code freeze: January 7, 2020

Generated by 🚫 dangerJS against 982510c

@jeherve jeherve changed the title General: fix PHP warnings that may pop up with PHP 7.4. General: fix PHP notices that may pop up with PHP 7.4. Dec 6, 2019
@kraftbj kraftbj added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Dec 6, 2019
@jeherve jeherve merged commit f996406 into master Dec 9, 2019
@jeherve jeherve deleted the fix/php74-notices branch December 9, 2019 09:30
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Dec 9, 2019
jeherve added a commit that referenced this pull request Dec 13, 2019
zinigor added a commit that referenced this pull request Dec 30, 2019
* Changelog: 8.1 additions

* Changelog: add #13858

* Changelog: add #13963

* Changelog: add #14174

* Changelog: add #14178

* Changelog: add #14175

* Changelog: add #14192

* Changelog: add #14196

* Changelog: add #14182

* Changelog: add #14218

* Changelog: add #14214

* Changelog: add #13757

* Changelog: add #14190

* Changelog: add #14131

* Changelog: add #14101

* Changelog: add #14203

* Changelog: add #14211

* Changelog: add #14224

* Changelog: add #14230

* Changelog: add #14241

* Changelog: add #14249

* Changelog: add #14264

* Changelog: add #14263

* Changelog: add #14256

* Changelog: add #10189

* Changelog: add #14240

* Changelog: add #14239

Also added some new entries to the testing file.

Co-authored-by: Igor Zinovyev <zinigor@gmail.com>
zinigor added a commit that referenced this pull request Dec 30, 2019
* Changelog: 8.1 additions

* Changelog: add #13858

* Changelog: add #13963

* Changelog: add #14174

* Changelog: add #14178

* Changelog: add #14175

* Changelog: add #14192

* Changelog: add #14196

* Changelog: add #14182

* Changelog: add #14218

* Changelog: add #14214

* Changelog: add #13757

* Changelog: add #14190

* Changelog: add #14131

* Changelog: add #14101

* Changelog: add #14203

* Changelog: add #14211

* Changelog: add #14224

* Changelog: add #14230

* Changelog: add #14241

* Changelog: add #14249

* Changelog: add #14264

* Changelog: add #14263

* Changelog: add #14256

* Changelog: add #10189

* Changelog: add #14240

* Changelog: add #14239

Also added some new entries to the testing file.

Co-authored-by: Igor Zinovyev <zinigor@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants