Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client reported an issue where translations were not being saved when an Advanced Custom Fields (ACF) field contained the live website's primary domain URL. Although the translated text was visible in the Advanced Translation Editor (ATE), it was not reflected on the front end after saving. This issue was specific to ACF link fields containing the primary domain URL, and did not occur with other external domain URLs.

Solution:
We investigated the issue by replicating the environment and testing various configurations. The problem was identified as a bug in the WPML plugin related to how URL translations were handled. We provided a workaround by modifying a specific line of code in the WPML plugin files:

if ( ! ICL_TM_COMPLETE === $job->status || ! isset( $job->elements ) ) {

was changed to:

if ( ICL_TM_COMPLETE !== $job->status || ! isset( $job->elements ) ) {

This change corrected the issue, allowing the translations to be saved correctly. We also recommended adding a custom XML configuration to ensure proper handling of link translations.

Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.

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 32 replies, has 2 voices.

Last updated by Dražen 1 month, 2 weeks ago.

Assisted by: Dražen.

Author Posts
July 27, 2026 at 5:56 am #18178119

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Sorry for wait, we have checked further adn managed to find and replicate bug.

Please try this workaround, it should work fine then.

Edit /wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-translation-job-factory.php

On line 15, change

if ( ! ICL_TM_COMPLETE === $job->status || ! isset( $job->elements ) ) {

with

if ( ICL_TM_COMPLETE !== $job->status || ! isset( $job->elements ) ) {

Then update the post again with a change and translate again.

We have also escalated this bug to our devs so should be fixed in the future versions.

Regards,
Drazen

July 27, 2026 at 12:33 pm #18179295

justinb-4

Hi,

Thank you for your response and for sharing the fix.

I wasn't able to find the code on line 15 in /wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-translation-job-factory.php

However, I searched for the same PHP condition and found it on line 15 in /wp-content/plugins/sitepress-multilingual-cms/classes/translations/TranslationElements/FilterJobUrlMigration.php

I replaced it there and uploaded the changes to the development environment.

It looks like the fix is working now.

I also noticed another point related to link translation, which I’ve explained in the video below. The link translation seems to work, especially for the Greenshift table links, only when we add the custom XML configuration that was provided in the original parent ticket (https://wpml.org/forums/topic/wpml-translated-urls-not-reflecting-on-front-end-for-secondary-language-pages/).

Video: hidden link

It seems the link translation only works when that custom XML configuration is added. I initially thought that XML configuration might already be included in the latest WPML version, but it looks like it may not be.

For now, we will add the WPML custom XML configuration to our production site along with this code change, so the link translation works as expected.

Please check the video and let me know your thoughts. Also, if you think we need to add or adjust anything else to make this work properly, please let me know.

Thank you again for your support so far.

July 27, 2026 at 1:22 pm #18179406

Dražen
Supporter

Hi,

Thank you for the update and for sharing the video.

I'm glad to hear the fix is working now.

Thank you also for pointing out the file location. I'll inform our 2nd tier team so they can verify the correct file name and path for the workaround.

Regarding the XML configuration, yes, that is expected. The custom XML needs to be included by the plugin author so WPML knows which fields should be handled for translation. As far as I'm aware, they are planning to include it in an upcoming version of their plugin, but feel free to check and confirm with them.

For now, adding the custom XML configuration alongside the code change is the correct approach.

Regards,
Dražen