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:
1234567891011
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:
12345678910111213
// 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.