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: Suppress deprecated warning when applying a coupon on Cart in PHP > 8.0 #45981
Fix: Suppress deprecated warning when applying a coupon on Cart in PHP > 8.0 #45981
Conversation
Hi @nielslange, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
Test Results SummaryCommit SHA: e3d2668
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Hi' i've submitted the related #45956, will this fix be applied to the final 8.8 release???(i'm seeing the fix added to 8.9 milestone, but the issue i've found affects the upcoming 8.8 right now) |
Hi @Danielspain22, we're still evaluating impact to determine the version of WC this will ship in. The PR will be updated once more information is available |
…P > 8.0 (#45981) * Fix deprecated warning when applying a coupon on Cart in PHP > 8.0 * Add changefile(s) from automation for the following project(s): woocommerce * Changed property type to protected --------- Co-authored-by: github-actions <github-actions@github.com>
* Fix: Suppress deprecated warning when applying a coupon on Cart in PHP > 8.0 (#45981) * Fix deprecated warning when applying a coupon on Cart in PHP > 8.0 * Add changefile(s) from automation for the following project(s): woocommerce * Changed property type to protected --------- Co-authored-by: github-actions <github-actions@github.com> * Prep for cherry pick 45981 --------- Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: WooCommerce Bot <no-reply@woo.com>
Submission Review Guidelines:
Changes proposed in this Pull Request:
New changes on #43872 introduced a deprecated warning when attempting to run
strlen
on a null string (billing_email in this case, which is not supplied in cart)This PR adds a new check to prevent that, and also adds the
string
$error_message
property to classWC_Coupon
to prevent another warning on the same class.Closes #45956 .
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
/wp-admin/tools.php?page=debug-log-manager
should not contain deprecated warnings statingDeprecated: strlen(): Passing null to parameter
or related to creation of a dynamic property callederror_message
Changelog entry
Significance
Type
Message
Comment
Fix: Suppress deprecated warning when applying a coupon on Cart in PHP > 8.0