Fix woocommerce object cache#1495
Open
Komarovski wants to merge 3 commits into
Open
Conversation
Apply the requested language even when a term already contains i18n_config. Persistent object caches may return term objects translated during an earlier request. Previously, name and description were translated only when i18n_config was first created, causing the first cached language to be reused.
Exclude the WooCommerce attributes cache group from persistent storage. WooCommerce caches the filtered attribute taxonomy data after qTranslate-XT has translated it. Since the cache key does not contain the current language, persistent object caches may serve attribute labels in the language of the first request.
Translate product attribute terms after WooCommerce retrieves them from its cache. WooCommerce product-term cache keys do not include the current language, so persistent object caches may return attribute values translated during an earlier request in another language.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes WooCommerce attribute labels and values being displayed in the language of the first request when a persistent object cache is enabled.
WooCommerce cache keys for attribute taxonomies and product terms do not include the current qTranslate-XT language. As a result, translated data may be stored and reused for other languages.
Changes
woocommerce-attributesgroup from persistent object caching.i18n_config.Testing
Tested with WooCommerce and LiteSpeed Object Cache using Memcached.
Verified that product attribute labels and term values switch correctly between Russian and Ukrainian after clearing and rebuilding the object cache.