EPIC issue in v2.1.9 with ACF integration
-
There is major issue with ACF integration was introduced in v2.1.9 of WP Multilang plugin. It causes information loss into translated ACF fields. Any attempt to edit localized ACF field results into loss of any other localization into this field besides current one.
Detailed information: issue is caused by revision 1797826, in particular by this change. It looks trivial, but change of filter priority was not synchronized into other places (1, 2, 3, 4). This missed synchronization, in its turn (due to specifics of remove_filter() that requires exact priority to remove the filter) causes translation filter to be kept in place and hence loading of old value of ACF field, that is expected to return multi-language string in fact returns translated string. Update of this string results into lose of all other locales.
I really hope that author will fix this issue and release new version asap. In mean time issue can be fixed by applying this patch manually:
Index: includes/integrations/class-wpm-acf.php <+>UTF-8 =================================================================== --- includes/integrations/class-wpm-acf.php (date 1515504770053) +++ includes/integrations/class-wpm-acf.php (date 1515504770053) @@ -196,9 +196,9 @@ return $value; } - remove_filter( 'acf/load_value', 'wpm_translate_value', 5 ); + remove_filter( 'acf/load_value', 'wpm_translate_value', 6 ); $old_value = get_field( $field['name'], $post_id, false ); - add_filter( 'acf/load_value', 'wpm_translate_value', 5 ); + add_filter( 'acf/load_value', 'wpm_translate_value', 6 ); $value = wpm_set_new_value( $old_value, $value, $acf_field_config ); @@ -258,9 +258,9 @@ } if ( $translate ) { - remove_filter( 'acf/load_value', 'wpm_translate_value', 5 ); + remove_filter( 'acf/load_value', 'wpm_translate_value', 6 ); $old_value = get_field( $field['name'], $post_id, false ); - add_filter( 'acf/load_value', 'wpm_translate_value', 5 ); + add_filter( 'acf/load_value', 'wpm_translate_value', 6 ); if ( ! wpm_is_ml_value( $value ) ) { $value = wpm_set_new_value( $old_value, $value, $acf_field_config );
- The topic ‘EPIC issue in v2.1.9 with ACF integration’ is closed to new replies.