Woocommerce-admin: REST API: Fatal in Performance Indicators Endpoint

Created on 22 May 2019  路  1Comment  路  Source: woocommerce/woocommerce-admin

Describe the bug
When wc-admin was deployed to WooCommerce.com, some REST API requests to non wc/v4 endpoints began to fatal. These endpoints powered integrations for support and as such caused workflow issues.

Uncaught Error: Call to undefined method WP_Error::get_data()
/var/www/wp-content/plugins/woocommerce-admin/includes/api/class-wc-admin-rest-reports-performance-indicators-controller.php

Background and possible ideas as to why this is happening:

p1558537350046400-slack-woocommerce-com

rest api bug

Most helpful comment

@jeffstieler what do you think about bringing over the "fix" from https://github.com/Automattic/woocommerce.com/pull/5993/files, the if ( is_wp_error( $response ) ) { returning $response. While it doesn't seem like that was the ultimate issue, it seems like it wouldn't hurt to have that as a safe path?

>All comments

@jeffstieler what do you think about bringing over the "fix" from https://github.com/Automattic/woocommerce.com/pull/5993/files, the if ( is_wp_error( $response ) ) { returning $response. While it doesn't seem like that was the ultimate issue, it seems like it wouldn't hurt to have that as a safe path?

Was this page helpful?
0 / 5 - 0 ratings