Skip to content

Fix lookForErrors Issue with 2.0.0 #173

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

Merged

Conversation

fastdivision
Copy link
Contributor

@fastdivision fastdivision commented Feb 17, 2018

Fixes #167

PHP Fatal error:  Uncaught Error: Cannot use object of type stdClass as array in /vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php:341

Stack trace:
#0 /vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php(378): Automattic\WooCommerce\HttpClient\HttpClient->lookForErrors(Object(stdClass))
#1 /vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php(414): Automattic\WooCommerce\HttpClient\HttpClient->processResponse()
#2 /vendor/automattic/woocommerce/src/WooCommerce/Client.php(82): Automattic\WooCommerce\HttpClient\HttpClient->request('orders', 'GET', Array, Array)

Example object:

array(1) {
  [0]=>
  object(stdClass)#44 (2) {
    ["code"]=>
    string(36) "woocommerce_api_authentication_error"
    ["message"]=>
    string(19) "API user is invalid"
  }
}

@claudiosanches claudiosanches merged commit 197a24f into woocommerce:master Feb 22, 2018
@CheatCodes
Copy link

Any plans tagging a new release including this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants