Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 16 replies, has 3 voices.

Last updated by Long Nguyen 1 year, 8 months ago.

Assisted by: Long Nguyen.

Author Posts
September 4, 2023 at 7:34 pm #14339099

cdhsC

I am trying to:
Switch categories on existing posts. But, when I select a new category and click Update, the previous category gets selected automatically right after the "post updated: view post" tooltip appears.

Link to a page where the issue can be seen:
This occurs on the back-end of any posts, e.g. hidden link

I expected to see:
A new category selected after I click Update.

Instead, I got:
The old category selected.

Your support staff Kor helped me on chat, and resaving permalinks seemed to fix the issue; however, the issue is back, and resaving permalinks doesn't fix it.

mov.gif
September 7, 2023 at 5:21 pm #14362011

Subash Chandra Poudel

Hi there,

The issue sounds like is being caused by to object cache or similar setup on the server. Can you please clear all caches on the site and server and see if it helps?

It could also be possibly caused due to some conflict from plugins or theme/code but I am unclear here how the issue is related to WPML. Does the issue get resolved when WPML plugins are deactivated? Or is it happening only for posts in translated/one language?

If the issue is not related to WPML we might not be able to help much here, but I recommend you to use the Brower Debugging tool as the following steps and see if it helps find the cause of the issue:

- Go to the post editor.
- Right-click on the page -> click on the "Inspect" option
- Click on the "Console" tab.
- Now, try updating the post with new categories and see if there are some errors in the console pointing to some plugin, theme or code.

Regards,
Subash

September 8, 2023 at 3:09 pm #14367601

cdhsC

Prior to reaching out I had already cleared the server (and client) cache, and turned off object caching. I have since moved a version of the site to a staging server, and disabled caching there (plus staging environments disable additional caching features), and the problem persists on both that and the production server.

I also had disabled all plugins prior to reaching out, so that only WPML Multilingual CMS was active. If I disable it, all the translations of each category show up of course, but the issue is fixed: category selections stick. Once I activate the plugin again, the issue shows up again. I actually walked through each plugin one at a time originally, and WPML being active is the only time the issue appears.

I also tried activating the base Twenty Twenty-One theme to see if any theme-related customizations were at fault. Having the unedited Twenty Twenty-One theme active, with WPML Multilingual CMS being the only plugin activated (and no object cache, with a fresh clear of the server cache and browser cache), the issue still manifests.

Great suggestion checking the JS console, hadn't thought of that, but it's showing no errors. The server PHP error log is also not reporting any warnings/errors.

I can provide access to the back-end of the staged version of the site if that would be helpful.

September 11, 2023 at 12:43 pm #14376271

Subash Chandra Poudel

Thank you for the delats,

I would need to take a closer look at your site. So would you please mind sharing temporary access (WP-Admin and FTP) to your site? Preferably to a test site where the problem has been replicated.

I have enabled a private reply for you to share the credentials securely, which means only you and I have access to it.

IMPORTANT: Please take a complete backup of the site first to avoid data loss.

✙ I would additionally need your permission to make a copy of the site with plugins like Duplicator and deploy it on my local machine to test the issue further.

Also, please let me know the exact steps/process I should follow on the site to see the issue.

Regards,
Subash

September 12, 2023 at 11:50 am #14383301

Subash Chandra Poudel

Thank you for the details,

However I am not able to login to the site, login seems to work fine but once I login I am sent to hidden link

Can you please recheck it from your end and re-share the details if required.

Regards,
Subash

September 12, 2023 at 12:04 pm #14383373

cdhsC

Sorry about that: I forgot I had a redirect in place to send anyone not using my IP address to the maintenance notice. I've removed that, and the original credentials should now work.

September 12, 2023 at 12:49 pm #14383905

Subash Chandra Poudel

Thank you for the details.

I can now log in and I see the issue is there only when your custom theme is active.

The issue seems to be due to a conflict between the custom theme you have and WPML.

Can you please contact the theme developer and see if they could track where the issue is coming from?

Regards,
Subash

September 13, 2023 at 12:03 pm #14389901

cdhsC

I've tried switching themes to the base theme, and it's still not working for me. Could you confirm under what circumstances it works for you? In this attached video, I'm using a different browser than normal (which has no extensions installed on it), with Twenty Twenty-One active, no plugins except WPML Multilingual CMS active, Object caching off, after resaving permalinks, and clearing local cache. My client sees the same on their end, too (using the browser they'll be creating posts in).

video: hidden link

September 13, 2023 at 2:34 pm #14390843

Subash Chandra Poudel

Thank you for the updates,

The issue indeed seems still to be there. The issue was not there when I tested yesterday with the default theme. But I can now see the issue even with the default theme.

To test the issue further I replicated the site on a test site at our end linked next:

hidden link

And I can see the issue there as well. After further troubleshooting, I found that the Must Use plugin WP Engine System that you can find at wp-admin -> Plugins -> Must-Use the issue seems to be resolved.

So the issue is most probably caused due to caches or some interference between WP Engine must-use plugin and WPML.

Can you please contact WP Engine as well and see if they are aware of this issue or if they have more insight on why the issue/interference is being caused?

Also, will it be possible for you to setup a new test site on WP Engine and see if the same issue is replicated there as well? This will help us verify if the issue is generally with WP Engine and WPML or is isolated with your site only.

Looking forward to your updates.

Regards,
Subash

September 14, 2023 at 2:03 pm #14397715

cdhsC

Thanks for your continued help! I won't be able to get to this today but have added it to my queue as soon as I'm able.

Also, note that this occurs on my local test site (it's using Flywheel's Local WP tool) which doesn't have the MU plugins, as I always delete the MU plugins folder for local development. So, I don't think it's a WP Engine issue since Local WP with no MU plugins is a quite separate environment.

I could see this being some quirk in the database that's maybe just affecting this site, since there's already a lot of content and settings going on; so, per your suggestion, when I get a chance, I plan to create a brand new WordPress site on WP Engine with just a Twenty* theme and WPML installed to see if the problem still manifests.

September 14, 2023 at 3:23 pm #14398005

Subash Chandra Poudel

Thank you for the updates.

The issue indeed is strange and could be due to the broken database only on your site but yes, let's first verify it on a clean WPEngine site and see how it goes.

Also, in the meantime if possible please contact WPEngine and see if they are aware of the issue or if they can provide more insight on why the issue is occurring.

Looking forward to your updates.

Regards,
Subash

September 15, 2023 at 8:21 pm #14405429

cdhsC

Confirmed, everything works fine with a fresh install of WordPress and WPML. Also confirmed right after that, if I leave all files as-is and just replace the fresh database with my existing database, the issue reemerges. So, since all the files remained unchanged, it must be something within the database.

Is it possible to export all WPML settings (and not content/etc.) to import them into a new site? I'd like to try switching back to the fresh database and only mimic the WPML settings from the actual site, so no other database baggage comes along to interfere with testing.

September 15, 2023 at 9:56 pm #14405557

cdhsC

I connected with WP Engine support. They did a bunch of cache-clearing-related work, but it didn't fix the issue (I sort of suspected as much since it also occurs in my non-WP Engine local environment).

Screenshot 2023-09-15 at 3.51.58 PM.png
September 17, 2023 at 6:55 am #14407523

Subash Chandra Poudel

Thank you for the details and updates!

I have now escalated the issue to our 2nd tier team for further troubleshooting.

I will let you know here as soon as the team have an update. Which might take a few days due to the weekends and current queue.

Regards,
Subash

October 3, 2023 at 7:50 am #14501959

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Subash is off and I will take care of this ticket. Please try the workaround below and see if it helps:
❌ IMPORTANT: Please backup your database and website before proceeding ❌

- Edit the file wp-content/plugins/sitepress-multilingual-cms/classes/display-as-translated/class-wpml-cache-terms-per-lang.php

- Around line 32, replace the code:

$all_terms = wp_cache_get( $post_id, self::CACHE_GROUP, false );

with this one

$all_terms = NULL;

Look forward to your reply.
Thanks