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 string + string for PHP 8.X #38534

Merged
merged 1 commit into from Jun 5, 2023
Merged

Conversation

rrennick
Copy link
Contributor

Changes proposed in this Pull Request:

This PR explicitly converts the string return values to float values.

Closes #38444.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Update to PHP 8.1
  2. Set all price tax settings to inclusive
  3. Create an order with a product, shipping, and a coupon
  4. Leave the order status as pending payment
  5. Load the customer payment page
  6. The customer payment page should show the correct amounts
  7. No errors should be logged to the error log

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label May 30, 2023
@github-actions
Copy link
Contributor

Test Results Summary

Commit SHA: 8c9ff70

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 52s
E2E Tests1940010020414m 47s

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.

@rrennick rrennick requested review from a team and jorgeatorres and removed request for a team May 31, 2023 18:38
@github-actions
Copy link
Contributor

Hi @jorgeatorres,

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:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@jorgeatorres
Copy link
Member

For testing, I used the following snippet as apparently string + string does work when string is numeric:

add_filter(
	'woocommerce_order_get_discount_tax',
	function( $val ) {
		return '';
	}
);

Copy link
Member

@jorgeatorres jorgeatorres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @rrennick!

@rrennick rrennick merged commit d8e5344 into trunk Jun 5, 2023
20 checks passed
@rrennick rrennick deleted the fix/38444-unsupported-operands branch June 5, 2023 10:28
@github-actions github-actions bot added this to the 7.9.0 milestone Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP 8.0: Unsupported operand types: string + string Errors
2 participants