Home›Support›English Support›[Resolved] Some of my fields from custom blocks are not appearing in the advanced translato
[Resolved] Some of my fields from custom blocks are not appearing in the advanced translato
This thread is resolved. Here is a description of the problem and solution.
Problem: The client has a custom ACF block called Header Block with multiple fields (title, subtitle, content, button label, etc.), but only the button label is showing, and the other fields are not. The client is following the WPML documentation for translating sites built with ACF but is facing an issue because the field names are not unique across blocks.
Solution: We recommend ensuring that all field names are unique. This is a known limitation with ACF and WPML, as WPML handles custom fields by name, which are stored in the meta tables. Therefore, translation preferences are set by field name, necessitating their uniqueness. Here are some resources to help understand the importance of unique field names:
If this solution is not applicable due to it being outdated or not relevant to your case, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, 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.
Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with first debugging steps or if I can perhaps help with the issue quickly.
Please check in WPML > Settings > Custom Fields Translation if the desired fields are set as translatable.
If that does not help, one of my colleagues will soon come to continue support.
I'm Osama from WPML forums support. I'll be glad to help you today.
1) First of all, sorry for the late reply; it was due to a higher workload. Please login to this sandbox site and import your ACF field groups and blocks. (hidden link)
After that, please create a test page using the problematic block and translate it to replicate the issue.
If the issue is replicable, please let me know how to reproduce it.
2) It's unrelated to the issue, but according to your Debug.info, the WP memory limit needs to be increased. PHP memory is fine, but WordPress uses 40Mb as default. The minimum requirements for WPML are 128 MB. (Kindly check this page https://wpml.org/home/minimum-requirements/)
You can increase it by adding the following code in your wp-config.php file right before the /* That's all, stop editing! Happy publishing. */ line:
I have confirmed that on your test site adding my block fields and adding it via functions.php works with the header-block.php file works.
I activated the glossary + advanced translation and can confirm that also works.
It looks like the problem was the fact that my field names need to be unique across blocks.
This is honestly very bad news as I have multiple blocks that have the field name "content" or "heading". Now it looks like I need to remake my whole site since if I change the field name the data that was added into it will dissapear...
How can I go around this issue?
Even something that can happen after the field was made in functions.php or something like that?
This is unfortunate because it works to create them in ACF but for some reasom ACFML plugin can't diferentiate between blocks that use the same field???
Why would anyone create a field "body" and have 2 different blocks work with "body" but because of WPML and ACFML it should be "body_2" for the second one.
Just want to make clear its not okay to set a warning as a Note on huge documentation page and expect people to not run into this issue.
As a final question is there anything that can be edited in the ACFML plugin (doesn't matter if an update will break things) as a temporary solution? Maybe for others that have this problem?
Something like using the field_key instead of the field_name?