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

[REST API] Transients not cleared when removing variations #9595

Closed
pawelkmpt opened this issue Nov 13, 2015 · 5 comments
Closed

[REST API] Transients not cleared when removing variations #9595

pawelkmpt opened this issue Nov 13, 2015 · 5 comments
Assignees
Milestone

Comments

@pawelkmpt
Copy link

I was looking for information about suggested way to remove product variations and I found it in #9543. I do that like it's written there and I noticed problem with transients not cleared after variations removal.

Process is following:

  • I add new variations to the product using PUT request
  • Than I remove expired ones by using DELETE in the loop

After that, when I make GET request on the product, error 500 occurs.

Error log:

[13-Nov-2015 10:41:25 UTC] PHP Fatal error:  Call to a member function exists() on boolean in /home/wordpress/wp-content/plugins/woocommerce/includes/api/class-wc-api-products.php on line 715
[13-Nov-2015 10:41:25 UTC] PHP Stack trace:
[13-Nov-2015 10:41:25 UTC] PHP   1. {main}() /home/wordpress/index.php:0
[13-Nov-2015 10:41:25 UTC] PHP   2. require() /home/wordpress/index.php:17
[13-Nov-2015 10:41:25 UTC] PHP   3. wp() /home/wordpress/wp-blog-header.php:14
[13-Nov-2015 10:41:25 UTC] PHP   4. WP->main() /home/wordpress/wp-includes/functions.php:886
[13-Nov-2015 10:41:25 UTC] PHP   5. WP->parse_request() /home/wordpress/wp-includes/class-wp.php:620
[13-Nov-2015 10:41:25 UTC] PHP   6. do_action_ref_array() /home/wordpress/wp-includes/class-wp.php:339
[13-Nov-2015 10:41:25 UTC] PHP   7. call_user_func_array:{/home/wordpress/wp-includes/plugin.php:579}() /home/wordpress/wp-includes/plugin.php:579
[13-Nov-2015 10:41:25 UTC] PHP   8. WC_API->handle_rest_api_requests() /home/wordpress/wp-includes/plugin.php:579
[13-Nov-2015 10:41:25 UTC] PHP   9. WC_API_Server->serve_request() /home/wordpress/wp-content/plugins/woocommerce/includes/class-wc-api.php:121
[13-Nov-2015 10:41:25 UTC] PHP  10. WC_API_Server->dispatch() /home/wordpress/wp-content/plugins/woocommerce/includes/api/class-wc-api-server.php:221
[13-Nov-2015 10:41:25 UTC] PHP  11. call_user_func_array:{/home/wordpress/wp-content/plugins/woocommerce/includes/api/class-wc-api-server.php:370}() /home/wordpress/wp-content/plugins/woocommerce/includes/api/class-wc-api-server.php:370
[13-Nov-2015 10:41:25 UTC] PHP  12. WC_API_Products->get_product() /home/wordpress/wp-content/plugins/woocommerce/includes/api/class-wc-api-server.php:370
[13-Nov-2015 10:41:25 UTC] PHP  13. WC_API_Products->get_variation_data() /home/wordpress/wp-content/plugins/woocommerce/includes/api/class-wc-api-products.php:155

WC_Product_Variable::get_children() uses get_transient() function and thats why I think it's transient issue.
Problem disappears once I update product on the edit page. Also $product->get_children() shows less children than.

@WPprodigy WPprodigy added the API label Nov 14, 2015
@pawelkmpt
Copy link
Author

Any updates on it?

@claudiosanches
Copy link
Contributor

@pawelkmpt nop!

@lkraav
Copy link
Contributor

lkraav commented Nov 24, 2015

@pawelkmpt perhaps you're able to attach a simple reproduction script here?

@claudiosanches claudiosanches self-assigned this Dec 1, 2015
claudiosanches added a commit that referenced this issue Dec 1, 2015
@claudiosanches claudiosanches added this to the 2.4.11 milestone Dec 1, 2015
@lkraav
Copy link
Contributor

lkraav commented Dec 1, 2015

Tyvm sir. We'll be putting this through testing tomorrow.

@claudiosanches
Copy link
Contributor

@lkraav We will release 2.4.11 this week.

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

No branches or pull requests

4 participants