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

Notice: id was called incorrectly. Product properties should not be accessed directly. #896

Open
vestaxpdx opened this issue Jun 15, 2017 · 4 comments
Labels
Milestone

Comments

@vestaxpdx
Copy link

vestaxpdx commented Jun 15, 2017

Hi

I have found a notice that is appearing after checkout is complete. When using Comet Cache Pro and Woocommerce

Notice: id was called incorrectly. Product properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), wp, WP->main, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_Gateway_PPEC_Checkout_Handler->maybe_return_from_paypal, WC_Gateway_PPEC_Checkout_Handler->do_payment, WC_Gateway_PPEC_Checkout_Handler->handle_payment_response, WC_Order->payment_complete, do_action('woocommerce_payment_complete'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, wc_maybe_reduce_stock_levels, wc_reduce_stock_levels, wc_update_product_stock, do_action('woocommerce_product_set_stock'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WebSharks\CometCache\Pro\Classes\Plugin->autoClearPostCacheOnWooCommerceSetStock, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please see Debugging in WordPress for more information. (This message was added in version 3.0 in MYSITE_URL/wp-includes/functions.php on line 4138

From digging you need to now call $product->id as $product->get_id()

This is being called in the function autoClearPostCacheOnWooCommerceSetStock($product) in the file: WP Plugins\comet-cache-pro\src\includes\traits\Plugin\WcpWooCommerceUtils.php

$counter += $this->autoClearPostCache($product->id);

Should be

$counter += $this->autoClearPostCache($product->get_id());

Do you guys support pull requests?

@raamdev
Copy link
Contributor

raamdev commented Jun 15, 2017

Thanks so much for the report! This does sound like something that needs to be updated.

Do you guys support pull requests?

Yes! 😄 If you'd like to submit a PR we'd be happy to include it in the next release. :-) Either way, we'll get this fixed for the next release, but I'd love for you to get the props!

Please submit the PR to the Comet Cache Pro repo, as we build the Lite version from the Pro repo, so the PR needs to go there.

@raamdev raamdev added this to the Next Release milestone Jun 15, 2017
@raamdev raamdev added the bug label Jun 15, 2017
@vestaxpdx
Copy link
Author

vestaxpdx commented Jun 16, 2017

Cool will do! This is fixed here: wpsharks/comet-cache-pro#318

raamdev added a commit to wpsharks/comet-cache-pro that referenced this issue Jul 18, 2017
@raamdev
Copy link
Contributor

raamdev commented Jul 18, 2017

@vestaxpdx Thanks so much for the PR! I have merged this into the dev branch and this will go out with the next release. :-)

@vestaxpdx
Copy link
Author

Awesome, cheers!

raamdev added a commit that referenced this issue Aug 8, 2017
- **New Feature: Memcached / RAM** (Pro): Comet Cache Pro now includes support for Memcached / AWS ElastiCache to serve the cache directly from RAM. This allows for a faster cache delivery than what is possible when serving the cache via disk. Memcached / AWS ElastiCache can be configured from **Dashboard → Comet Cache Pro → Plugin Options → RAM / Memcached**. See [Issue #47](#47)
- **Enhancement**: Added `Referrer-Policy` to whitelist for cachable HTTP headers. See [Issue #892](#892).
- **Bug Fix** (Pro): The Cache Statistics feature was broken when the PHP `disk_total_space()` and/or `disk_free_space()` functions were disabled by the PHP configuration. Comet Cache now handles this scenario gracefully by hiding disk-related stats when those functions are not allowed. See [Issue #775](#775)
- **Bug Fix** (Pro): The HTML Compressor was returning an empty string upon encountering an invalid UTF-8 sequence. See [Issue #871](#871) reported by a Comet Cache user.
- **Compatibility** (Pro): Many improvements to the Pro software update system, including changes to the API Endpoints and the Proxy Fallback endpoint. See [Issue #879](#879) and [Issue #315](wpsharks/comet-cache-pro#315) for full details.
- **Compatibility**: Fixed a WooCommerce compatibility issue that was generating a "Notice: id was called incorrectly. Product properties should not be accessed directly." Props @vestaxpdx. See [Issue #896](#896).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants