This thread is resolved. Here is a description of the problem and solution.
Problem:
Original ACF field deleted by translated field
Solution:
Please see the comment below: https://wpml.org/forums/topic/original-acf-field-deleted-by-translated-field/#post-14103861
Relevant Documentation:
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: Exception
This topic contains 13 replies, has 2 voices.
Last updated by Waqas Bin Hasan 1 year, 4 months ago.
Assisted by: Waqas Bin Hasan.
Author | Posts |
---|---|
July 20, 2023 at 5:02 pm #14074601 | |
davidF-18 |
I am trying to: Add new ACF field at top of existing page Link to a page where the issue can be seen: I expected to see: New ACF field added ONLY in page in question (original language) Instead, I got: New ACF field added to original page and translations. New ACF field inherits text from first existing field, all existing fields inherit text from field below thus unsyncing all existing content. All ACF fields are set to Copy Once. If I switch the WPML / ACF option to ‘expert’, and set the flexible content to ‘copy once’ then duplicate the page it should work. But instead the content from the first section is removed. I’ve checked the WPML/ACF docs and this is what you say we need to do. There’s a similar issue on your forum but no solution: https://wpml.org/forums/topic/cchange-on-one-of-our-translation-content-goes-missing-on-the-source-language-page/ |
July 21, 2023 at 12:24 pm #14079967 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for contacting the support. Have you tried with only WPML and ACF plugins, as well as, with a default WordPress theme (i.e. 2021 or 2023)? Please check in this context and see if the issue can be reproduced? IMPORTANT: Take full backup of your website and database beforehand. Please let me know and I'll try my best to help you further on the matter. Regards. |
July 21, 2023 at 2:01 pm #14080489 | |
davidF-18 |
Hello, Thanks for the suggestions, we've tried and the issue persists with a default Worpdress theme, and also if we deactivate all other plugins. However the problem does not occur when we deactivate WPML and the WPML ACF plugin. If I give you a site login, could you check the WPML settings we are using for the ACF Field Groups? I can also provide a backup of the site if that would help. Thanks, |
July 21, 2023 at 2:31 pm #14080593 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates. Yes, please provide admin access to your website to check the issue in detail? You can create a separate admin user for this purpose, which can be deleted afterwards. Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend. Remember to take full backup of your website and database before proceeding. However, a staging/test site is highly recommended, because I may need to try some changes/fixes on the site (including plugins & themes deactivation), which may cause conflicts with the live site otherwise. Please confirm it in your next reply or let me know if you do not agree with the mentioned. I've set your next reply as private to share this information safely. IMPORTANT: If you don't see the section for providing access information, do not write in the message box or the information may appear as public. See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security. |
July 24, 2023 at 6:43 am #14085871 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the access and details. I am working on this and 'll get back to you as soon as I have some progress. |
July 24, 2023 at 12:19 pm #14089327 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience on this. I observed the issue just like you mentioned and then further went to investigate by deactivating all plugins except the most necessary (WPML, ACF related). If I use your theme (Gran Hotel Domine), the field groups appear while editing the page. While, if I switch to another standard WP theme (i.e. 2021 or 2023), after saving the page, field group disappears and doesn't even reappear if I switch back to your theme. Looks like these groups are being controlled by some custom logic in your theme? or perhaps I am missing something? I actually need to test the reported issue with only the plugins I mentioned above, as well as, with a standard theme. Since your theme isn't on our compatibility list, I need to eliminate a chance of any incompatibility. |
July 24, 2023 at 2:55 pm #14090679 | |
davidF-18 |
Hello Waqas, Could you try again now please? I've updated the ACF Field Group settings so that the Pagebuilder layout will be present with the Default Template used by the Twenty-TwentyThree theme. You should now be able to test the issue with a standard theme. Thanks, David |
July 25, 2023 at 9:54 am #14095047 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thanks David, I'm working on it and 'll get back to you as soon as possible. |
July 25, 2023 at 12:16 pm #14096233 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience and cooperation. Here's what I did, if I understood it correctly (little long but divided into points for understanding): A) The problem you mentioned when providing the access (private message above - https://wpml.org/forums/topic/original-acf-field-deleted-by-translated-field/#post-14081025): - I noticed that the Page Builder fields group was set to "Same fields across languages". B) What I tried on the existing page: - As per my understanding, you wanted to add different fields in translations. For example, if I add a "Content Section" in English (default), while I should be able to add different number of "Content Section"(s) to French (secondary). I understand that at first duplication, there should be same fields across the translations, while later these can vary as needed. - So I changed the field group setting to "Different fields across languages", which presets (most of) the fields to "Copy once" (https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/recommended-custom-fields-translation-preferences-for-acf-and-wpml/#pre-set-translation-preferences). - Now, when I went to the same "Shopping" page. I added a Content Section (#6) with test text and saved (in English). - Then edited French, and there was no new Content Section added. So I added one with some text content and saved. Then I also removed it from translation and it was only removed from French. The English one stayed in place. C) What I tried on a new page: - I then tried this with a new page "Test Page WPML July 25". Here I added 2 sections in English. Then clicked + icon to add French translation where I added translations of these sections. - Then I edited English, added one more section and saved. Edited French and there was no 3rd section added. I added 2 more section in French and saved. While on English it remained with 3 sections. - Then I removed 3rd section from English, while French still had the ones I added (4 sections). - I removed 2nd, 3rd and 4th section from French and saved, thus, leaving it with only 1 section. While English stayed with 2 sections as I left in there. Does this sound good to you? or am I missing something or understanding incorrectly? |
July 26, 2023 at 9:07 am #14101185 | |
davidF-18 |
Good morning Waqas, Thank you for the detailed description of the different steps, that all seems to be correct. We have tried switching the theme back to the Domine 2023 and initially the problem reoccurs, with a password icon appearing on the translated pages (see attached) despite the Field Group still being set to "Different fields across languages". However, saving the ACF "Page Builder" field group again then fixes the issue. We now understand that because we have set ACF to save the fields in a local JSON file (as ACF recommend), the WPML setting is not maintained when the theme is switched. The Field Group must be saved again after changing theme for the correct WPML setting to apply. Can you check and confirm this? We've also tried this on the main development site that we are working on and found that the Field Group has to be saved twice before the correct WPML setting (Different fields across languages) is applied correctly. After saving once, the padlock icon (attached) is still present on the translated pages. Also, do we need to make any other special accommodations for the ACF/WPML plugin when saving field groups to the acf-json folder? Thanks in advance, David |
July 26, 2023 at 12:08 pm #14103621 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
I am consulting with my team and 'll get back to you about that ACF JSON. |
July 26, 2023 at 12:39 pm #14103861 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hello David, I 've got a detailed explanation about ACF's local JSON (hidden link) vs WPML, I am copying the words from the team, please consider followings:
More to this:
Given that since you'll be using the same theme (unless decide to change in the future), this should be fine now. As you've already saved the ACF fields settings. However, perhaps you are continuously developing and improving the theme (and related functionality), it is good to keep field settings updated (whichever suits you best). In any case, remember to take a full backup before making/applying major changes!! I hope this clarifies your queries? Please let me know. Regards. |
July 27, 2023 at 10:48 am #14109771 | |
davidF-18 |
Dear Waqas, Thank you very much for your help and advice re the ACF WPML settings and the local JSON. We have tested several times on the main development site we are working on and the behaviour between original and translated pages is as expected as long as the field groups are saved after the theme is switched, so that the JSON file is correct for the theme in question. As far as we can see, the issue is now resolved. Thanks once again for your assistance. Regards David |
July 27, 2023 at 1:38 pm #14111099 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi David, Thank you so much for your understanding and cooperation. I am closing this ticket as resolved. Please feel free to contact again anytime for anything WPML related. Have a great time, Regards. |