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

Open
herrvigg opened this issue Jun 23, 2018 · 2 comments
Labels
legacy issue Legacy issue imported from original repo

Comments

@herrvigg
Copy link
Collaborator

Issue by lemartinet
Friday Feb 05, 2016 at 02:45 GMT
Originally opened as qTranslate-Team/qtranslate-x#348


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 !!

@herrvigg
Copy link
Collaborator Author

Comment by lemartinet
Friday Mar 18, 2016 at 07:45 GMT


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

@herrvigg herrvigg added the legacy issue Legacy issue imported from original repo label Jun 23, 2018
@herrvigg
Copy link
Collaborator Author

Comment by ahmnabil
Wednesday Jul 19, 2017 at 11:51 GMT


hi any update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy issue Legacy issue imported from original repo
Projects
None yet
Development

No branches or pull requests

1 participant