• Oscar Gare

    (@oscargare)


    Hi there,
    I’ve found that the WCML_Attributes::filter_product_variation_post_meta_attribute_values_in_current_language function breaks the get_post_meta function 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_meta action.

    Could you fix this bug? Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Nicolas V.

    (@nicolasviallet)

    Hi Oscar,

    Thanks for reporting this issue. I was able to reproduce and verify the behavior you described, and I’ll escalate it to the WCML development team. I’ll keep you updated once I have their feedback.

    Thanks again for helping us improve our product!

    Plugin Support Nicolas V.

    (@nicolasviallet)

    FYI, our devs are on it, and the issue should be fixed in the next release.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.