Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

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 2 voices.

Last updated by Marcos Vinicios Barreto 3 weeks ago.

Assigned support staff: Marcos Vinicios Barreto.

Author Posts
January 14, 2020 at 11:46 pm #5293461

johnB-47

I am trying to: have an ACF Taxonomy multiple checkbox field, that's set the "copy once" (or copy), to load the translated options when translating a CPT.

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

I expected to see: hidden link
Note bottom right, the "Associated Studios" is not appearing on the Spanish translation.

Instead, I got:
I expected to see the same as in English, but with the translating content.

-

When looking at how the info is stored on the DB, the field for AssociatedStudios is showing a double serialization and and incorrect mapping of the translation ID, like:
s:18:"a:2:{i:0;N;i:1;N;}";

instead of this on the English version:
a:2:{i:0;5;i:1;8;}

Note that the Spanish taxonomies are already created and linked correctly in English.

This gets solved if I manually go to that CPT entry and save manually from WP admin.
But Not when translated through your editor or through a translator.

-

I know you had a previous bug related to this, so we updated all plugins, but issue remains.

January 15, 2020 at 5:23 pm #5300101

Marcos Vinicios Barreto
Supporter

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

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

Hello,

Thank you for contacting WPML Support. I would like to request temporary access (wp-admin and FTP) to your site to take 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.

January 17, 2020 at 10:50 pm #5314277

johnB-47

In order to provide you access to our staging SFTP, we will need you to provide us with a SSH public key so we can set up access.

Access will be read only, assuming that's ok.

If so, is it possible for you to create a SSH public key?

Thanks!

January 21, 2020 at 2:01 am #5328043

Marcos Vinicios Barreto
Supporter

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

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

Hello,

Thank you for the updates and sorry for the bit of waiting due the weekend. In this case, let's try an alternative method to give a further look in your website and debugging your issue, for that, please consider:

To best troubleshoot the issue, please make a snapshot of your site using the Duplicator plugin: https://wordpress.org/plugins/duplicator/. This will allow me to try and duplicate the error so that I can run further tests without interrupting your live site.

Once the snapshot is complete, either upload the snapshot ZIP file and the installer.php file to a file sharing service such as Dropbox (and share the link in your reply) or right click the Duplicator links in your wp-admin and paste in your reply.
Please note: It is important to reduce the size of the package so please exclude some paths like /cache or /uploads and also exclude archives and media files.I will also need the username and password of an account that was created BEFORE creating the duplicator package.I will enable the next reply to be private so only you and I have access to it!

Thank you for your collaboration. Have a nice day.

January 22, 2020 at 7:06 pm #5343677

Marcos Vinicios Barreto
Supporter

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

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

Hello,

Please, take a look at my private reply above and let me know when the migration process is done. Thanks.

January 23, 2020 at 9:13 pm #5353193

johnB-47

Migration to cloudways completed!

January 24, 2020 at 9:45 pm #5359423

Marcos Vinicios Barreto
Supporter

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

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

Hello,

Thank you for the updates. I am jumping here to let you know I started to working on your website using the migrated copy, I would need some extra hours do debug your issue into details, as I am at the end of my shift for today, I will be back on the next monday with some more details for you in case your issue is not urgent. Thank you for your continued patience and understanding, have a nice day.

January 27, 2020 at 6:29 pm #5372057

Marcos Vinicios Barreto
Supporter

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

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

Hello,

Thank you for your continued patience while waited for a solution. After a detailed look I confirmed the cause of the issue was the translation preference for this field that was set incorrectly. So, in order to fix the issue in your website, please, try the following:

1 - In your WordPress Dashboard > People click to edit the person post where the issue is seen.

2 - In the post editing screen click the 'Show system fields' option in order to display all the custom fields available for this post (see attached screenshot customer_screen_42).

3 - Make the fields 'associated_studios' and '_associated_studios' translation preferences set as 'translate' and then apply the changes (see attached screenshot customer_screen_41).

4 - Make a minor editing for the custom fields of the problematic post in the default language and update the post.

5 - Now, click to edit the problematic post translation, make sure everything is set as complete and save your translation again.

Here is the result: hidden link

See: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#making-acf-fields-translatable

Please, let me know if the steps above help to fix your issue, have a nice day.

January 27, 2020 at 9:49 pm #5372869

johnB-47

Thanks Marcos for looking into it.

Just to clarify, are you saying that all ACF Taxonomy fields need to be set to "Translate" instead of "Copy" or "Copy once"?

Because when reading the docs I understood that ACF fields that behave like objects (like repeaters, objects), need to be set to "Copy", but maybe I got it wrong.

If you can confirm that ACf taxonomy fields need to be set to "Translate" if we expect them to link to their translations..?

And expanding, what about other similar fields, like ACF "Relationship" fields? Those seem work fine with the "Copy" option. Or do they need to be set to "Translate" as well?

Thanks again!

January 28, 2020 at 7:34 pm #5380241

Marcos Vinicios Barreto
Supporter

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

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

Hello,

Thank you for the updates. Regarding your questions:

1 - "Just to clarify, are you saying that all ACF Taxonomy fields need to be set to "Translate" instead of "Copy" or "Copy once?"

In the case of your taxonomies terms it only works with the 'translate' option, beucase if you set it as copy you will be passing the same terms IDs to the translated page which doesn't exists and this is why no terms is shown, when set to 'translate' then you will be telling your post/page to use the terms translations, not the default terms itself.

2 - "If you can confirm that ACf taxonomy fields need to be set to "Translate" if we expect them to link to their translations..?"

Yes, it should be the correct behavior, as the system assigns the translated terms, then the all the terms properties, including its translated url should be assigned as well.

3 - "And expanding, what about other similar fields, like ACF 'Relationship' fields?"

I am not sure if I have already dealt with a case of 'relationship' fields translation, but I guess you are talking about it: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#how-to-handle-image-and-post-object-fields

Please, let me know if it helps, have a nice day.

January 29, 2020 at 2:41 am #5381119

johnB-47

Hi,

I followed your steps, but this doesn't fix our issue.

It appears correctly on the front end, but if I go to edit the translated page with the normal WP editor...I see that the taxonomy fieds checkbox are Not checked.

And if I look at the database, for that custom field (example: associated_studios), it shows that it has been saved using the default language taxonomy IDs.
Maybe thats how suppose to be...but when trying to edit through normal WP editor, I get no checkboes check.

I see the checkboxes labels translated, but none check.
And if I save the post, since the checkboxes are empty, it deletes the previous value stored, so now it doesnt even have the default English ones.

In your test, did you try editing or viewing the translated page/postype through the normal WP editor?
If so, do you see the checkboxes check for AssociatedStudios?

Thanks!

January 30, 2020 at 1:33 pm #5392559

Marcos Vinicios Barreto
Supporter

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

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

Hello,

Thank you for the updates. Regarding your question:

"It appears correctly on the front end, but if I go to edit the translated page with the normal WP editor...I see that the taxonomy fieds checkbox are Not checked."

It is not a bug, it is how the Advanced Custom Fields Multilingual plugin handles the translations for these kind of fields, it is explained at https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#how-to-handle-image-and-post-object-fields, it explains the following:

Translated posts will be associated with objects in the original language, which is allowed. On the front-end, posts will display correct relations, however, on the post edit screen, you will see these fields as empty.

Please, let me know if it helps to clarify your questions, have a nice day.

January 30, 2020 at 6:43 pm #5394715

johnB-47

Ok, great, understood that.

But still its not selecting checkboxes on the backend and that doesnt seem right. Since if I save, it deletes the previous one.

The solution we encounter is to display taxonomy fields as dropdowns instead of checkboxes.
By using dropdowns we Do get the English value on the backend at least.
That sounds like a good solution?

Also, since now we changed those Taxonomy fields to "Translate" as you suggested, when we send the item for translation, the translator sees the "key" fields to translate, like "field_5e31113fec768", for each taxonomy field.
Is that ok? im assuming they just need to copy it as it is.

Thanks!

January 31, 2020 at 2:04 pm #5399775

Marcos Vinicios Barreto
Supporter

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

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

Hello,

Thank you for the updates. Regarding your points:

1 - "But still its not selecting checkboxes on the backend and that doesnt seem right. Since if I save, it deletes the previous one"

Does it happen when editing the translated content using the WordPress standard page/post editor? Does it happen if your disable the 'Advanced Custom Fields Multilingual'? I think the best way to edit translated content using the WordPress standard page/post editor is to duplicate the content from the original post to the translated one and then edit it as an individual translation, otherwise 'Advanced Custom Fields Multilingual' will handle it causing this behavior as explained before.

See: https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/

2 - "By using dropdowns we Do get the English value on the backend at least.
That sounds like a good solution?"

I didn't test it, but as it meets your requirement for the translated content, then it should be a feasible solution.

3 - "When we send the item for translation, the translator sees the 'key' fields to translate, like 'field_5e31113fec768', for each taxonomy field. Is that ok? im assuming they just need to copy it as it is."

It happens because the ACF system fields is also set as 'translate' you can make the system fields for the taxonomy field as 'copy' or 'copy once' and then keep the regular field as 'translate'.

Review my reply at: https://wpml.org/forums/topic/double-serialization-with-acf-checkbox-field-set-to-copy-or-copy-once/#post-5372057 in order to learn how to set the translation preferences for system fields.

If you don't want to set the system fields you can just keep these values unstranslated ir order to make sure things will keep working properly.

Hope it helps, have a nice day.