jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Simple Payments: PHP Warning: number_format() expects parameter 1 to be float, string given

Open brbrr opened this issue 5 years ago • 5 comments

It seems that this warning does not break anything UX wise, so I labeled it as Low priority.

Steps to reproduce the issue

I'm not really sure how to reproduce it locally, but the warning appears quite often during E2E tests in CI. I assume it's related to the fact that E2E tests insert a string into a numeric-only field

What happened instead

[28-Jan-2020 09:31:59 UTC] PHP Warning:  number_format() expects parameter 1 to be float, string given in /home/travis/build/Automattic/jetpack/modules/simple-payments/simple-payments.php on line 267
[28-Jan-2020 09:31:59 UTC] PHP Stack trace:
[28-Jan-2020 09:31:59 UTC] PHP   1. {main}() /home/travis/wordpress/index.php:0
[28-Jan-2020 09:31:59 UTC] PHP   2. require() /home/travis/wordpress/index.php:17
[28-Jan-2020 09:31:59 UTC] PHP   3. wp() /home/travis/wordpress/wp-blog-header.php:16
[28-Jan-2020 09:31:59 UTC] PHP   4. WP->main() /home/travis/wordpress/wp-includes/functions.php:1255
[28-Jan-2020 09:31:59 UTC] PHP   5. WP->parse_request() /home/travis/wordpress/wp-includes/class-wp.php:729
[28-Jan-2020 09:31:59 UTC] PHP   6. do_action_ref_array() /home/travis/wordpress/wp-includes/class-wp.php:387
[28-Jan-2020 09:31:59 UTC] PHP   7. WP_Hook->do_action() /home/travis/wordpress/wp-includes/plugin.php:544
[28-Jan-2020 09:31:59 UTC] PHP   8. WP_Hook->apply_filters() /home/travis/wordpress/wp-includes/class-wp-hook.php:312
[28-Jan-2020 09:31:59 UTC] PHP   9. rest_api_loaded() /home/travis/wordpress/wp-includes/class-wp-hook.php:288
[28-Jan-2020 09:31:59 UTC] PHP  10. WP_REST_Server->serve_request() /home/travis/wordpress/wp-includes/rest-api.php:305
[28-Jan-2020 09:31:59 UTC] PHP  11. WP_REST_Server->dispatch() /home/travis/wordpress/wp-includes/rest-api/class-wp-rest-server.php:329
[28-Jan-2020 09:31:59 UTC] PHP  12. WP_REST_Posts_Controller->update_item() /home/travis/wordpress/wp-includes/rest-api/class-wp-rest-server.php:946
[28-Jan-2020 09:31:59 UTC] PHP  13. WP_REST_Posts_Controller->prepare_item_for_response() /home/travis/wordpress/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:758
[28-Jan-2020 09:31:59 UTC] PHP  14. apply_filters() /home/travis/wordpress/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:1550
[28-Jan-2020 09:31:59 UTC] PHP  15. WP_Hook->apply_filters() /home/travis/wordpress/wp-includes/plugin.php:206
[28-Jan-2020 09:31:59 UTC] PHP  16. do_shortcode() /home/travis/wordpress/wp-includes/class-wp-hook.php:288
[28-Jan-2020 09:31:59 UTC] PHP  17. preg_replace_callback() /home/travis/wordpress/wp-includes/shortcodes.php:199
[28-Jan-2020 09:31:59 UTC] PHP  18. do_shortcode_tag() /home/travis/wordpress/wp-includes/shortcodes.php:199
[28-Jan-2020 09:31:59 UTC] PHP  19. Jetpack_Simple_Payments->parse_shortcode() /home/travis/wordpress/wp-includes/shortcodes.php:325
[28-Jan-2020 09:31:59 UTC] PHP  20. Jetpack_Simple_Payments->format_price() /home/travis/build/Automattic/jetpack/modules/simple-payments/simple-payments.php:149
[28-Jan-2020 09:31:59 UTC] PHP  21. number_format() /home/travis/build/Automattic/jetpack/modules/simple-payments/simple-payments.php:267

brbrr avatar Jan 28 '20 10:01 brbrr