Open
Overview of the issue
When using ACF – Advanced Custom Fields with the ACFML plugin, if a Clone field is set to Copy Once, the field values cannot be retrieved in the original language on the front end. The issue occurs when the field group containing the Clone field is set to Different fields across languages or when the field is manually set to Copy Once in Expert mode.
Workaround
Please, make sure of having a full site backup of your site before proceeding.
- Open the …wp-content/plugins/acfml/classes/class-wpml-acf-custom-fields-sync.php file.
- Look for line 42.
- Replace:
public function clean_empty_values_for_copy_once_field( $value, $post_id, $field ) { if ( '' === $value && ! $this->value_has_been_emptied( $field ) && isset( $field['wpml_cf_preferences'] ) && WPML_COPY_ONCE_CUSTOM_FIELD === $field['wpml_cf_preferences'] && ! $this->isFieldType( $field, 'group' ) ) { $value = null; } return $value; } - With:
// WPML Workaround for compsupp-7767 public function clean_empty_values_for_copy_once_field( $value, $post_id, $field ) { if ( '' === $value && ! $this->value_has_been_emptied( $field ) && isset( $field['wpml_cf_preferences'] ) && WPML_COPY_ONCE_CUSTOM_FIELD === $field['wpml_cf_preferences'] && ! $this->isFieldType( $field, 'group' ) && ! $this->isFieldType( $field, 'clone' ) ) { $value = null; } return $value; }
When is this going to be implemented?
I am having terrible issues with this, and i can’t keep manually patching the class after each update in every website
Hi Eytan,
I can see that Itamar has already escalated your feedback to the development team. He’ll keep you updated in the support ticket.
6 months have passed and this solution has not yet been implemented!
I have to manually change it and be careful not to update the plugin locally.
This is a BUG on your part and the solution YOU suggested must be implemented in the code.
Hi Eytan,
Thanks for reaching out. This issue is on our development roadmap, and we’ll update the errata once a fix is implemented. We appreciate your patience in the meantime.
That is the reply i got months ago. The solution is adding a single line to the code. A line that your developers suggested and I can assure is working.
Please make this happen, it really should not take months.
Hi Eytan,
There hasn’t been any new version of ACFML since the issue was reported, so the workaround only needs to be applied once.
I’ve forwarded your feedback to the internal report so the devs can prioritize it and evaluate the fix for the next release. We don’t have an ETA at the moment.