Home›Support›English Support›[Resolved] ACF relationship field search field disabled in translated posts in v2.1.x of ACFML
[Resolved] ACF relationship field search field disabled in translated posts in v2.1.x of ACFML
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're experiencing an issue where the search input field on an ACF relationship field is disabled in translated posts, this might be due to a change introduced in version 2.1.0 of the Advanced Custom Fields Multilingual (ACFML) plugin. This problem persists in version 2.1.3. Solution: We recommend modifying a line of code in the ACFML plugin. In the file
This change might resolve the issue. However, please note that this solution could become outdated or might not apply 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 problem persists, please open a new support ticket.
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.
I think we finally figured out the correct settings. The Publications post type must be set to Translatable Only (not fallback to default) and those ACF fields set correctly as previously mentioned. With these two settings changed, I am not able to reproduce it in the posts that you shared links of that were not previously working:
hidden link
hidden link
hidden link
Let me know if you still see it disabled anywhere. Thanks!
Sorry but I disagree that this is a solution, it would fundamentally change how content is currently being shown on the site.
I would like the Publications post type to be in "fallback to the default language" mode. If I change it to "translatable only" then the other languages on my client's site will be missing a lot of content that was there before.
The reason I believe this is a bug is because "Translate or fallback to default" mode means there *might* be a translation. If there's not a translation then show the default language item. This behaviour is what we want, this has been a feature of WPML for a long time.
So surely it is a bug that ACFML is disabling fields in "Translate or fallback to default mode". It is a perfectly valid scenario for a translation to exist and for those fields to be editable.
For example:
English - Original language.
French - Translation exists, I want to be able to translate the fields in to French.
Spanish - Translation does not exist, so show the original language version (English).
I can understand why you would prefer to use Fallback to default. Our developers have intentionally set this field to disable with that option, but have found a workaround. I can't say for sure if this is something that will change permanently, that will be up to our development team. In the meantime, you can use this workaround:
In acfml/classes/class-wpml-acf-relationship-field.php line 14:
Thanks for the code change, that's helpful. I'm a bit apprehensive about applying patches to plugins that might receive an update and remove the patch.
I've added a new JS file to the admin area from my theme with this inside which should hopefully continue to work even if the plugin's updated. I'll see how this goes and revert to the PHP change if needed.