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

Object caching prevents seeing correct category translations when switching to a different language #348

Closed
lemartinet opened this issue Feb 5, 2016 · 4 comments

Comments

@lemartinet
Copy link

Hi !
Thanks for the great plugin. I tried to look into the repo but I could not find a solution to my problem, except some related discussion in #17 . When I activate object caching on my website, if I browse first the french version, and then switch to the english version, the categories are not in the correct language. I've "google-investigated" the problem and it seems to be possible to solve it by adding a key cache_domain in the get_terms args
It was solved in WPML : https://wpml.org/forums/topic/get_terms-and-caching-bug/
Polylang : https://wordpress.org/support/topic/taxonomies-mix-up-with-activated-object-cache

I tried to do it by myself, but I have a very limited knowledge of qtranslate-x and caching. I tried adding a filter in my functions.php theme:

function get_terms_args( $args ) {
        global $q_config;
        $lang = $q_config['language'];
        $key = '_' . $lang;
        $args['cache_domain'] = empty( $args['cache_domain'] ) ? 'qtx' . $key : $args['cache_domain'] . $key;
        return $args;
}
add_filter('get_terms_args', 'get_terms_args');

But that doesn't solve the problem... That would be great if you could provide such a patch for qtranslate-x !!

@lemartinet
Copy link
Author

Hi! Any updates on that particular issue?
Thanks for your help!
Manu

@ahmnabil
Copy link

hi any update on this issue?

@kannan18k
Copy link

I have same problem any solution ?

@lemartinet
Copy link
Author

Sorry, I'm not using qtranslate-x anymore.

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

3 participants