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.

This topic contains 13 replies, has 4 voices.

Last updated by Stavros 5 months ago.

Assigned support staff: Mateus Getulio.

Author Posts
December 10, 2021 at 3:27 pm #10163279

richardR-22

Hello, we have inherited a site using WPML, which does not appear to have been setup correctly. We need to change all the Translation Preferences for the ACF Fields to Copy Once. However, whenever we hit save, the new value is not saved and it remains set to "Don't Translate". Other non-WPML field settings change as expected. This same behaviour occurs on our development & staging site.

We have checked all settings against another working site we have, and are unable to see any obvious difference.

A GIF of this behavior can be seen here: hidden link

Please let me know if you would like access to the staging site.

Regards,
Richard

December 11, 2021 at 6:14 pm #10167745

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

Hi,

thanks for contacting us.

Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

Could you please update all WPML plugins?
If you can't see any updated available, please go to Plugin > Add new > Commercial and update from there.

If after updating you still can't save, could you please try checking if there are any errors in the browser console?

December 13, 2021 at 10:01 am #10173473

richardR-22

Thank you for the response. I can confirm all plugins are up to date in our development environment. To confirm:

Advanced Custom Fields Multilingual: 1.8.2
WPML CMS Nav: 1.5.5
WPML Media: 2.6.4
WPML Multilingual CMS: 4.4.10
WPML SEO: 2.0.1
WPML Sticky Links: 1.5.4
WPML String Translation: 3.1.8
WPML Translation Management: 2.10.6

There are no errors in the console.

Regards,
Rich

December 13, 2021 at 6:39 pm #10177801

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Rich,

Thanks for your contact. I'll be happy to assist you with this!

The versions that you listed above are not the latest. Currently, WPML Multilingual CMS is in the 4.5.2 version, String Translation in 3.2.0, Media Translation in 2.7.0, and so on. Please check it out from here: https://wpml.org/account/downloads/

If you can't see the updates notifications in the Plugins -> Add New -> Commercial tab, can you please try to manually update the plugins by following the procedure below?

- Go to plugins
- Disable and remove WPML
- Download a fresh version here https://wpml.org/account/downloads/
- Click on add plugin at the top and on upload
- Upload the files you download and install them
- Activate the plugins once the installations are completed

Then, kindly check if the issue persists. If the answer is yes, I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. 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.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

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

Please, let me know if you need any additional details. Have a nice day.

December 14, 2021 at 7:42 pm #10185693

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Thank you for providing the credentials.

Upon further inspection, we were able to conclude that the issue seems to be theme-related. We have momentarily switched it to a default one (Twenty Twenty-One), and the problem does not occur in this case.

Can you check and confirm it? Please change your theme to a default one and verify that the translation preferences for the advanced custom fields can be modified and saved without problems.

Having said that, may I kindly ask you to get in touch with your theme support team and address the issue with them? They'll have more clues and tools to debug it, in order to find the culprits and provide a possible solution.

Please keep us posted about this investigation. We're looking forward to your reply.

Kind regards,
Mateus.

December 15, 2021 at 12:03 pm #10190503

richardR-22

Hi there,

Thank you for the response. We have conducted some further investigation an discovered some code in the theme (as mentioned this was a site that we inherited) hooking into the ACF load field that sets the wpml_cf_preferences value if it is not set.

add_filter( 'acf/load_field', function ( $field ) {

    //var_dump($field['wpml_cf_preferences']);

    if ( empty( $field['wpml_cf_preferences'] ) ) {
        $field['wpml_cf_preferences'] = 3;
    }

    return $field;
} );

However, this appears to not be working correctly, as it is always setting a value of 0.

We are now able to save changes by removing this code.

However, I'm hoping you can advise. We want to change the settings for all custom fields to Copy Once. We have tried a find and replace in the ACF-JSON files of changing the value to 3, but it appears that WPML does not think that the settings have been saved, and reverts them to copy, even though we have set them manually and changed the timestamp of the file.

There are approximately 1200 fields that need changing, and performing this manually would be extremely laborious. Is there a hook we can use and function that will enable this?

Any advice would be appreciated.

Kindest regards,
Rich

December 15, 2021 at 8:21 pm #10193423

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thanks for your reply.

This issue seems related to the settings 'max_input_vars' on the server. Hence, could you please increase the max_input_vars to 10,000, and let me know if that helps? If you face difficulties making this change, you can contact your hosting provider and ask them to increase this.

Furthermore, another attempt that you can try (if the settings still don't save in the backend), is to create a wpml-config.xml file in order to override the translation preferences for the custom fields. Please check our documentation related to see more information about config files: https://wpml.org/documentation/support/language-configuration-files/

Please let me know if these suggestions solve the issue. Looking forward to your reply.

Best,
Mateus.

December 20, 2021 at 9:13 am #10215587

richardR-22

Hi,

Thank you for the response. Unfortunately upping the max_input_vars does not solve this.

We've had a look at the wpml-config.xml file, but it appears that this requires each field to be named, which as there are 1200 would prove as time consuming as manually switching each to Copy Once. Is there a query that can be used that would achieve this instead?

Regards,.
Rich

December 20, 2021 at 8:54 pm #10220145

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Thanks for your reply.

I've visited your website and it seems that all fields are set to 'copy-once'. Have you managed to solve it?

Moreover, I checked out if there is a way to achieve this, but so far I couldn't find a solution for it. I asked my colleagues to have a look at this issue in order to see if there's anything I'm missing.

I'll come back here as soon as one of my colleagues reply back to me (which it shouldn't take long).

Thanks,
Mateus.

December 21, 2021 at 9:26 am #10222463

richardR-22

Hi Mateus,

Thanks for this. The reason everything is set to Copy Once is because we have slightly modified the code that was there originally to change all fields to Copy Once when loaded. We then resaved all Field Groups. However, the downside of this is that we can now not do any manual overrides to any individual fields, as they revert to Copy Once.

Regards,
Rich

December 21, 2021 at 7:26 pm #10226739

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi Rich,

Thanks for your patience while we investigate this issue.

I've consulted our second-tier specialists, and it seems that it's not possible to achieve it without custom code. When the fields are created, there is a setting to adjust the translation preference, but if you have installed the ACFML later, then you need to edit each field because these fields have no pattern, no prefix, and have a unique name.

Even if it is done programmatically, we'd need the names to be typed manually in the program. Also, I double-checked it and currently, we don't have a specific hook for what you're trying to achieve: https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

As I said, it would be necessary to configure it with some code customization. I'm afraid it would be beyond the scope of this support forum but we recommend that you check our contractors page: https://wpml.org/contractors/.

Alternatively, please feel free to request this feature at the link: https://wpml.org/suggest-a-new-feature-for-wpml/. We will analyze it and upon further check, it can be available in the future versions of WPML.

If you need anything else don't hesitate to contact us. Thanks for your understanding.

Best,
Mateus.

December 22, 2021 at 11:09 am #10230915

richardR-22

Hi Mateus,

No problem, thank you for the response, we will go back to the client and explain.

Finally, after updating to 4.5.2 we have noticed that the Multilingual Content Setup fields no longer appear on a page: hidden link

We assume this is related to the the fact that the WPML Translation Management plugin has now been deactivated and integrated into the core. How can we re-enable these fields showing on a page?

Kindest regards,
Rich

December 22, 2021 at 7:11 pm #10234675

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

It's correct, the Multilingual Content Setup screen is not visible anymore on the Edit pages since the integration of Translation Management into the core plugin (4.5.0).

Unfortunately, there is no option to show the fields back on the Edit screens. But we can offer a workaround:

- Install the JSM Show Post Meta plugin: hidden link
- Go to the edit screen of the post. The fields that are being used on the post will be displayed at the bottom of the page
- Then, you can search/change the settings for these fields on WPML -> Settings

Again, you can also request the returning of this feature at the link: https://wpml.org/suggest-a-new-feature-for-wpml/.

Since we could conclude the main issue of this ticket, I hope we are good to close here. Feel free to contact us any time if you need assistance with our products.

Kind regards,
Mateus.

December 22, 2021 at 10:28 pm #10235025

Stavros

Hey Mateus,

Are you using ACF with php export file? If yes, check the exported code of ACF setup, the wpml_cf_preferences is written there too.