Home›Support›English Support›[Resolved] Links from ACF link type of fields do not get automatically adjusted according to the respective lan...
[Resolved] Links from ACF link type of fields do not get automatically adjusted according to the respective lan...
This thread is resolved. Here is a description of the problem and solution.
Problem: You are experiencing issues with links not automatically adjusting to the correct language version when duplicating pages across different English language versions (UK, Australian, Canadian) on your website. This problem specifically affects links populated from the link type of ACF field.
Solution: We have identified a bug affecting the translation of the LINK field within repeater/flexible fields. While we are working on a permanent fix, we recommend using the
wpml_permalink
hook as a temporary workaround. You can find more information and guidance on implementing this solution through the following documentation links:
If this solution does not resolve your issue or seems irrelevant due to being 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 further assistance is needed, 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.
Background of the issue:
The website is built on the ACF plugin and is set up with subdirectories for language versions. The UK version is set as /en-uk/, Australian /en-au/, Canadian English /en-ca/. The USA version is the default en version of the site where we want to have all the content duplicated into the other language versions from for 3 lang version that will all be written in English. In some of these duplicated pages we will want to go and edit some bits of the content where need be.
This issue is when we duplicate pages for different versions, all links still point to the USA version.
We have flexible content fields that the pages are build of. And in the multilingual setup we have "different fields across languages" set for the Flexible Content fields group hidden link
The pages are set as translatable hidden link
ACF field groups are set as Non Translatable hidden link
We need to have the duplicates of the pages created because the 3 lang versions will all be in English. Thus, we are not considering translation option for creating the pages. Nonetheless, we have tested this with translation feature as well and the issue with the links persist.
We do not want to go through all the pages and edit the links manually. We need to have the links adjusted accordingly for all the mentioned links on the page once the page is created. We see that this is working for certain types of ACF fields, i.e. the links generated via the relationship field get auto adjusted despite the page where the link links to hasn't yet been created within that lang version. Pls see this page for reference hidden link - US version hidden link - UK version.
The bottom pre-footer tiles items are populated via the relationship field and they've got their urls auto adjusted to the en-uk version hidden link despite those pages do not yet exist within the UK version website hidden link. While the links in the right blue box didn't get adjusted in the same way because the pages they link to do not exist yet within UK version. If the page exists hidden link, it will auto generate its link as needed hidden link. And it also works as needed for the contextual links hidden link. When clicking that link, it takes me to hidden link page despite this page is not yet created on wp-admin side - referring back to the screenshot mentioned above hidden link there are only 4 pages created in the UK lang version so far and the CTE Support & Resources page is not among those 4. The question is why this auto adjusting works only for some types if the ACF fields, i.e. relationship, wysiwyg editor, but not for the link type of the ACF field?
Symptoms:
The links populated from the link type of ACF field don't get auto adjusted to the lang version the page is created for.
Questions:
How to solve the issue with the links populated from the link type of ACF field to get auto adjusted to the lang version the page is created for?
How do we add our WP theme to this installation? Not sure if we can quickly replicate all necessary settings in this minimal installation of WordPress you have created. Wouldn't it be easier if you just log in and test everything on out staging server? We can grant necessary access. I described the issue in the original message and the page where you can see it.
Pls advise.
since you are using a custom theme we would need to test it without, I am trying to test if tissue still happens in minimal and with the WP default theme, that is why we can confirm quickly if it is a bug or not test site.
If I understand correctly your case, this should not be complicated to replicate:
- Set up WPML language and related settings as on your website
- Install ACF and ACFML and create 1 field group that has the same fields as the one you have an issue
- Create 1 page, translate
- Create 2nd page, add a link to 1st page and translate / duplicate
Check if the issue still happens.
Please check if I have correctly explained your case or if something missing and if you can try to reproduce it. I can try to do the same steps myself but I would like you to do it since there might be some settings /steps you are using that I am not or are not recommended.
Pls see this page hidden link which is a duplicate of the homepage, not translation. The issue with links not adjusted can be seen as I explained in the original message with the link ACF type of field if the page doesn't exist within this lng version yet. But it gets adjusted for relationship type of the field.
thanks, I wanted to check if the link works if the link page is translated, but after re-translating and creating other pages it seems your code doesn't show any fields on the front, so it might not be adapted.
Anyway, there is currently a bug from our side where the LINK field inside repeater / flexible filed it not being translated correctly. We are working on a permanent fix, but it will take time. In the meantime, workaround is to translate manually or try to use wpml_permalink hook:
Thank you for your help with the issue of the link fields not to be auto adjusted to the translation. We have used your suggested workaround which looks to be working fine as a solution for the time being.
Yet, we have faced another issue with the links to be not translated in the content of the post - neither in the content, not in the flexible content additional fields. We have a custom post type "Stories" where we have detected this issue after having created a duplicate of the story hidden link. This issue also persists with the default posts hidden link
We have replicated it also on your clean WP installation hidden link - pls see this for reference hidden link. Scan doesn't help either hidden link
Pls advise what we can do about it. Thank you.
New threads created by Dražen and linked to this one are listed below:
As the original issue is resolved and we limit 1 issue per ticket to keep things clear I will open a new ticket for your other issue.
Regards,
Drazen
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.