Plugin breaks get_post_meta function for product variations
-
Hi there,
I’ve found that theWCML_Attributes::filter_product_variation_post_meta_attribute_values_in_current_languagefunction breaks theget_post_metafunction for product variations. This function is a filter callback for the get_post_metadata filter that translates variation attributes.
The problem is that it returns a value from the cache for all metakeys, regardless of whether the metakey is an attribute.This is how you can reproduce the problem:
$metadata = get_post_meta( $variation_id ); //This call to the filter function stores the meta in the cache.
update_post_meta( $variation_id, '_dummy_value', 'val'); // Add a meta for the product variation.
$metadata = get_post_meta( $variation_id ); //This should returns all meta data that should include _dummy_value, but it does not contain it because the WCML_Attributes filter returns a value store in the object cache.A workaround is to clear the cache in the
update_post_metaaction.Could you fix this bug? Thank you.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.