Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Fix PHP notices on orders data store #1870

Merged
merged 1 commit into from
Mar 21, 2019

Conversation

Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Mar 21, 2019

Fixes #1862.

Fixes PHP notices appearing in some queries to /reports/orders.

Notices

PHP Warning:  Division by zero in /wc-admin/includes/data-stores/class-wc-admin-reports-orders-data-store.php on line 180
PHP Notice:  Undefined property: stdClass::$pages in /wc-admin/includes/api/class-wc-admin-rest-reports-orders-controller.php on line 80
PHP Notice:  Undefined property: stdClass::$page_no in /wc-admin/includes/api/class-wc-admin-rest-reports-orders-controller.php on line 82
PHP Notice:  Undefined property: stdClass::$pages in /wc-admin/includes/api/class-wc-admin-rest-reports-orders-controller.php on line 83

Detailed test instructions:

  • Set define( 'WP_DEBUG_LOG', true ); in your wp-config.php file, so error logs are stored in wp-content/debug.log (it might depend on your WP installation, though, for me they were stored in /var/log/php-fpm/www-error.log).
  • Go to WooCommerce > Dashboard.
  • Verify the notices described above do not appear anymore in the error log.

Copy link
Member

@ryelle ryelle left a comment

Choose a reason for hiding this comment

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

Errors are gone, thanks! 👍

@Aljullu Aljullu merged commit 67a31cf into master Mar 21, 2019
@Aljullu Aljullu deleted the fix/1862-orders-data-store-php-notices branch March 21, 2019 14:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants