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: ,

Assisted by: Prosenjit Barman.

Author Posts
August 25, 2023 at 10:38 am #14290951

Daniel Faessler

Hi Christopher

Thanks for looking into this. Really strange behaviour.

Pls let me know, if further info or documentation is needed.
Issue is shown on hidden link, but to further investigate, I setup a dev site with current "All in one backup" whose restores helped my repeatedly reproducing the behaviour and allowed me to use hidden link as a sandbox.

I setup a admin-user for you. Please let me know, should you need the credentials.

I as well cleared cache, removed ghost entries from the translation tables etc. in Troubleshooting area of WPML, but it didn't help.

Thank you very much and kind regards, Daniel

I am trying to:
Update french translation of german page with WPML-editor.

Link to a page where the issue can be seen:
hidden link

I expected to see:
When entering WPML-editor (french) to translate german page, I expect to see the current and valid contents of the translations in the respective fields according to the publicly shown french translation (= 'french page').
hidden link

Instead, I got:

Starting point:
1> german and french page both show correct and current content
2> german page has been updated
3> french translation has to be updated to reflect the changes of german page

Step 1.
When entering WPML-editor, I get outdated or completely untranslated content in certain fields (although french page shows correct content).

Step 2.
After updating the content of those affected fields with copy/paste of correct content from french page, the translation status of french shows 100% translated.

Step 3.
Now, french page shows partially content different from that above entered in WPML-editor or still outdated content.

Step 4.
In re-entering french WPML for this page, all fields still show as translated.

Step 5.
I update a random Avada-Element (i.e. adding a dot in a title-field) from the german page. To check functionality WPML-Editor.

Step 6.
Now french WPML-editor shows completely different fields marked as untranslated and some again with old or untranslated content.

Step 7.
After again updating the content of those affected fields with copy/paste of correct content from french page, the translation status of french shows again 100% translated.

Step 8.
Now the french page finally shows correct content.

My assumption:
It seems, WPML-editor is stuck with old pointers to orphaned an/or outdated content. And only repeatedly updating the main page and its WPML-content fixes the false pointers and gets rid of the orphans.
This affects not every page in the same degree. Some don't show this behaviour, some may even need more circles of WPML-update, page-update, WPML-update... to fix this.

System / Setup:
WP, Theme and Plugins are up to date, above behaviour is shown with all plugins deactivated with the exception of following plugins which are essential for both the Avada theme and WPML:
> Avada Builder, Avada Core
> WPML Media, WPML Multilingual CMS, WPML String Translation

To reproduce this behaviour:

URL german page to be translated page:
hidden link

URL WPML french translator:
hidden link

15 output shows translation in between revisions.gif
14 wpml translated content and overall state falls back.gif
13 icon wpml editor after edit original page.gif
12 original page revisions after edit.gif
11 changed random content in original language.gif
10 original page revisions before edit.gif
06 check state wpml translation.gif
05 output after translation.gif
04 icon wpml editor after translation.gif
03 after saving translation first time.gif
02 icon wpml editor.gif
01 output before translation.gif
August 28, 2023 at 7:22 am #14297609

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support. Sorry for the delay in responding due to the weekend.

Thank you for taking the time to briefly describe the problem. Based on your explanation, it appears that the issue you're having is similar to one issue that was reported in WPML 4.6.4. Please check the Errata below for further details.

- https://wpml.org/errata/translations-get-erased-when-editing-a-page/

The solution for that particular issue was added in WPML 4.6.5. Since you're having the issue even after updating the plugin, a closer inspection will be required to understand the root cause. I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT
-Please make a backup of site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Looking forward to your response and cooperation in this matter.

Best Regards,
Prosenjit

August 29, 2023 at 4:30 am #14303743

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for sharing the access information.

I checked as per your instructions and have successfully been able to trace the issue. It appears the issue arises from a specific caching rule set for the Strings.

However, after implementing the fix outlined in this errata [ https://wpml.org/errata/translations-get-erased-when-editing-a-page/ ], the issue is no longer happening on your site. Everything seems to be working fine. Please check this video[ hidden link ] for a better understanding.

The issue you've reported should have been fixed in WPML 4.6.5. But, please be informed that I already have notified the dev team about this matter. I will surely let you know if I have any updates on this. Till then, please use the same workaround on the site where you're having the issue. Please make sure to take a full backup of the site before adding the solution.

Feel free to let me know if you need further assistance or clarification. I will be happy to help.

Best Regards,
Prosenjit

August 29, 2023 at 7:16 am #14304379

Daniel Faessler

Hello Prosenjit

Thanks for your speedy solution and this workaround. It's really appreciated 🙂

I will implement the workaround and check if everything works correctly for me as well.

But before that, following questions:

I noticed in your screencast that to save changed content in WPML editor you first clicked 'save' and then again 'save & close'.
> Is this really necessary or suffice to click 'save & close'?

Regarding the edited code:
> Will the changes to the code be lost and have to be applied again after future updates of WPML or its modules?

Thanks again and kind regards, Daniel

August 29, 2023 at 8:01 am #14304835

Daniel Faessler

Hello Prosenjit

This is what I did:

> I restored the dev site to its state when I originally started this ticket. So the dev site was again without any of your alterations of content or code.

> I applied suggested code changes and updated code.
--> see attached 03-current-wpml-code.gif

> I entered WPML-editor french
hidden link

> I still see untranslated content in various fields and content in comparison with publicly displayed french content
--> see attached 01-still-not-translated.gif
--> see attached 02-actual-state-of-translation.gif

I did not save or update the content itself (neither french translation nor german original), but left the dev-site now in its state as it was when I originally startet this ticket - but *with* code altered as suggested.

To make sure, I restored the dev site to its original state again and *only* changed plugin-code.

Could you please look further into this?

Thanks and kind regards, Daniel

03-current-wpml-code.gif
02-actual-state-of-translation.gif
01-still-not-translated.gif
August 30, 2023 at 2:57 am #14309719

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello Daniel,

After implementing the code, the French side will still display German content on the Translation editor. However, once you update the French translation with the correct content and save it, any future modifications to the German content won't overwrite the French translation when updating. I hope you can understand.

Please find the answers to the questions you mentioned below.

- You don't need to click "save & close" after clicking the 'Save' button. I did so to leave the editor and return to the WordPress interface. Either option works for saving.

- Once you update the plugin, the modified code will be removed. But, please be assured that the solution for this issue will be included in the future version of WPML.

Please let me know if there is anything else you need help. I will be happy to assist you.

Best regards,
Prosenjit

August 30, 2023 at 1:32 pm #14314295

Daniel Faessler

Hello Prosenjit

Thanks for your information.

So, you say there is no way to salvage the already made translations?

Right now, we have 315 pages and 601 posts incl translations in the system.

And with every update we risk losing the existing translation, unless we copy / paste the already published content in their respective fields in WPML.
Correct?

Re future updates:
How will I learn that code doesn't have to be edited after updates anymore?

Kind regards, Daniel

August 31, 2023 at 9:32 am #14318715

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi Daniel,

I can totally understand your concern. The translations you've already completed will remain intact. However, if you modify any post/page and update its translation before adding the code, you might encounter a problem. Thus, I recommend first adding the code, then making changes to a different page/post, and afterward updating the translation. Try with one first. I believe this should prevent any issues from arising.

Make sure to take a full backup before that.

Since the problem happens only after updating the translation, Once you've updated the plugin, make a slight modification to any post or page, then attempt to update its translation. If the translation remains intact, it indicates the issue has been resolved and there's no need for code adjustments. However, if the translation gets overwritten, please inform us, and we'd be glad to take another look.

For your information, we have successfully been able to reproduce the issue and our dev team is working on resolving the issue. I hope the patch for this issue will be included in the future version of the WPML plugin.

Let me know if you need any further assistance or clarification. I will be happy to help.

Best Regards,
Prosenjit

August 31, 2023 at 2:06 pm #14321267

Daniel Faessler

Hello Prosenjit

Thanks for getting back to me.

In trying to understand the future mechanism I did some testing.
The tests have been made on the dev-site to which you still have access.

After completion of below described step 6, I restored the dev site again to its state before any content changes but with edited WPML-plugin according to your instructions.

These are the steps I undertook to test:

1. Check if WPML-code is correct as by your instructions.
--> see 00-plugin-code-updated.gif

2. Update original language content (edited the title in adding a point).

3. Check state of WPML-translator.
> It shows an overall translation state of 52%.
> In this case, much of the translation already entered is lost.
--> see 01-after-change-of-field.gif

4. Restore the site to its state before.

5. Again check if WPML-code is correct as by your instructions.

6. Directly enter WPML-translator without changing the original language.
> It shows an overall translation state of 77%.
> In this case, a little less of the translation already entered is lost.
--> see 02-original-language-not-changed.gif

So, unfortunately, not all the already made translations remain intact, when using the altered WPML-plugin.

Could you please dive a bit deeper into this and let me know how to achieve lossless translations in the future?

Thanks and kind regards, Daniel

02-original-language-not-changed.gif
01-after-change-of-field.gif
00-plugin-code-updated.gif
September 1, 2023 at 7:14 am #14324641

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello Daniel,

I appreciate the detailed steps you provided. I followed them as instructed and observed that despite implementing the code, several translations on your site still get changed. But I also noticed that once the translation is updated, it doesn't get changed when you try to update the translation next time.

However, I also performed the same checks in my development environment and was unable to replicate this particular scenario.

However, I recommend waiting for the upcoming update or any hotfix for the WPML plugin. Our development team has made several improvements related to this issue, and I believe updating the plugin should solve the issues. In the meantime, please continue to use the code solution. If you observe any missing translations, kindly copy them from the Translated page, input them into the translation editor, and save the translation.

Please let me know if there is anything else you need help.

Best Regards,
Prosenjit

September 1, 2023 at 7:46 am #14324903

Daniel Faessler

Hello Prosenjit

Thanks for checking this on your development environment as well.

I know that this particular behaviour dosen't occur on all translations, and one cannot 'count' on this erratic behaviour showing itself on every translation.

In the past we stumbled upon this situation from time to time and thought - since this doesn't affect all translations - it was a caching problem of browser, avada or webserver (and it is actually a caching problem - but caused by the erroneous code).

Why do I mention this?

It was rather coincidal stumbling across this particular page and being able to reproduce this error. We know, once one touches the original language, the erratic behaviour changes or vanishes completely.

So, may I suggest you take a full backup of our dev-site without having made any changes?
Because I'm pretty sure that after installing this on your development environment, you'll be able to reproduce this (the behaviour I described yesterday) on your end as well.

I mainly mention this to allow your dev team to dive deeper into this and check this based on '100% uncorrupted erratic data'.

I hope I make myself clear.

Meanwhile I inform the admin of the production site and instruct her accordingly.

Although - I must say - it's rather bad news, because obviously we cannot trust the translation mechanism in its actual state, regardless of having the code modified or not.
And - who knows? - perhaps the cause lies in other modules as well? Because even after changing the module as instructed, we continue to get false or lose translations.

So, please, pull a backup of our dev-site (I already restored its content to the very original state) and let me know if you really cannot reproduce this behaviour on your end.

Because should this be the case - we would not only have to deal with one unsolved mystery, but with two...

Kind regards and thank you indeed for your support, Daniel

September 2, 2023 at 6:31 am #14329673

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi Daniel,

I can understand your concern and will try our best to address the issue. I've installed the package in my local setup and was able to reproduce the issue. From my initial assessment, it appears to be related to the problem you mentioned initially. However, I've already informed our development team for a more in-depth analysis. As soon as I have any update on this matter, I will surely let you know.

I appreciate your patience and cooperation in this matter.

Best Regards,
Prosenjit

September 6, 2023 at 12:31 pm #14352273

Daniel Faessler

Hello Prosenjit

I installed latest version WPML 4.6.6 and String Translation 3.2.8

More info about it
https://wpml.org/changelog/2023/08/wpml-4-6-6-patchfix-release/?utm_source=at&utm_medium=emails&utm_campaign=wpml-4-6-6

Can you confirm that these updates resolve the reported bug and I *don't* have to manually insert the code snipped from now on?

Or do you advise continuing to insert code snippet?

Kind regards, Daniel

September 6, 2023 at 1:20 pm #14352805

Daniel Faessler

Hello Prosenjit

After updating to WPML 4.6.6 and String Translation 3.2.8 I did some testing.
The tests have been made on the dev-site to which you still have access.

After completion of below described step 4, I restored the dev site again to its state before any content changes but with updated WPML-plugins. This should allow you to easily reproduce the persisting error.

These are the steps I undertook to test:

1. Update original language content (edited the title in adding a point).

2. Check state of WPML-translator.
> It shows an overall translation state of 56%.
> In this case, much of the translation already entered still is lost.
--> see 101-after-change-of-field.gif

3. Restore the site to its state before.

4. Directly enter WPML-translator without changing the original language.
> It shows an overall translation state of 72%.
> In this case, a little less of the translation already entered still is lost.
--> see 102-original-language-not-changed.gif

So, unfortunately, even with the updated plugins not all the already made translations remain intact.

Could you please dive a bit deeper into this and let me know how to achieve lossless translations in the future?

Thanks and kind regards, Daniel

102-original-language-not-changed.gif
101-after-change-of-field.gif
September 7, 2023 at 7:55 am #14356619

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello Daniel,
Thank you for the updates and for sharing the steps to see the issue.

I wanted to inform you that I already have created an internal ticket regarding the issue you've reported. Our development team is currently checking the issue. Rest assured, as soon as we have any updates or findings, I will surely reach out to you with the details.

Thank you for your continued patience and cooperation in this matter.

Best regards,
Prosenjit

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.