-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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 8.2 deprecation warnings #35763
Comments
I have some more:
|
Please fix code in init.php, line 127 as it produces insane amount of deprecation notices. |
It looks like there is a fairly simple - if short-term - solution to the immediate problem of the debug log filling up with '000s of deprecated notices: #[AllowDynamicProperties] https://php.watch/versions/8.2/dynamic-properties-deprecated |
@wvega 👋🏽 ... quick check: is more work required here given the above merged PRs? |
Hey there @barryhughes! Yes, we need small fixes in at least the following files:
Those cover the deprecation warnings that I see while running tests locally, but I believe the comments in this issue include other warnings that I haven't tracked down. Since those files touch different areas, my plan is to open a couple other PRs with subsets of those changes, but I haven't had the time to prepare those PRs and write tests where necessary. |
Excellent—thanks for confirming 🤝 |
Not sure how helpful this is, but this should sort the strstr error on line 139 of includes/wc-page-functions.php (which I noticed wasn't in your list above but is mentioned in #33808 ). if ( ( $path && strstr( $path, $customer_logout ) ) || ( $query && strstr( $query, $customer_logout ) ) ) { Hope that does help, apologies if not! |
Related discussion from 2021: #31316 |
One day until the WP 6.2 release I get still these deprecated warnings with PHP 8.2:
|
Monitoring error logs is a nightmare since this adds dozens of new lines per page load. All you have to do is add |
I see that #33808 is closed and I've read a comment from @rrennick that deprecation warnings for PHP 8.2 are planned to be addressed in WC 7.9 currently in beta. So here are the last 4 that I can find when running our PHPUnit tests against the latest development version (some may still related to PHP 8.1):
Hope it helps. |
There are places where we may do this, but it's worth noting this isn't always suitable, and often will not be the best fix. Adding it everywhere would work against the reason PHP decided to deprecate dynamic property creation it in the first place. |
@Chouby Thanks for reporting these. As requested in the comment you referenced, could you create new issues for warnings/errors that had not been previously reported (and addressed)? It's much easier & faster to fix these in small batches/PRs than to try to do a single PR that addresses all of them. "The fixes for reported PHP 8.2 issues should also be addressed in WC 7.9.0. Create a new issue if we missed any or you find any new ones that haven't been reported." |
6586109-zen |
WooCommerce core generates a few deprecated notices when running with PHP 8.2. This was breaking our CircleCI build. This commit adds a workaround to this problem by manually updating WooCommerce core files. The workaround can be removed once woocommerce/woocommerce#35763 is addressed. [MAILPOET-4620]
@rodrigoprimo I think we got all of these. Could you confirm? |
@rrennick, thanks for working on this. Were all the changes already released? I'm asking because the easiest way for me would be to check this against a released version of WooCommerce. If they still need to be released, can I get a nightly build somewhere? |
@rodrigoprimo They should all be addressed in WC 8.3. |
@rrennick, I ran our test suite again and found three more deprecations that I believe I missed before:
I can confirm that the deprecations that I had reported earlier were fixed. Thanks! |
@rodrigoprimo Thanks. Both have already been reported I'm not able to reproduce this one running the unit tests in either 8.2 or 8.3RC5. Could you look at your tests for the code that is triggering these warnings? |
Good to know that they have been reported already.
We have the full stack trace for the error: https://output.circle-artifacts.com/output/job/5540c07a-103e-410a-9409-ecaadf150b2d/artifacts/0/tests/_output/exceptions/error--2023-11-20--20-07--065edcdbe7.html Does this help? You can see more examples in the "Artifacts" section: https://app.circleci.com/pipelines/github/mailpoet/mailpoet/16266/workflows/1d7a02d6-41a3-48b4-a657-e6e012836e16/jobs/276027/artifacts The warnings are being triggered by a few of our acceptance tests that check for some of MailPoet's integrations with WooCommerce. |
@rodrigoprimo Thanks for the info. I'll close this as we have the issues covered in the two linked issues. |
Prerequisites
Describe the bug
Similar to #33808 which refers to PHP 8.1, I'm seeing a few deprecation warnings when running WooCommerce with PHP 8.2.0 RC6.
Expected behavior
WooCommerce fully compatible with PHP 8.2 without any deprecation warnings. Please note that those warnings will become fatal errors in PHP 9.0.
Actual behavior
Here is the list of deprecations warnings that I'm seeing:
Steps to reproduce
I got those warnings while running the MailPoet automated test suite with PHP 8.2 RC6 (https://app.circleci.com/pipelines/github/mailpoet/mailpoet/12388/workflows/c2b20f29-eb1b-4e3a-abc2-15306b59b720/jobs/211887). MailPoet test suite uses the latest version of WooCommerce to perform part of the tests. So unfortunately I don't have instructions on how to reproduce those warnings with just WooCommerce, but I imagine that most of them will show up by just running WooCommerce with PHP 8.2 RC6 and visiting a few pages.
WordPress Environment
Not applicable per what was mentioned above.
Isolating the problem
The text was updated successfully, but these errors were encountered: