Critical bug when using WPML + ACF

The powerful WPML plugins for multilingualism and Advanced Custom Fields for your own fields are part of the basic equipment in many installations. It is annoying when the interaction leads to malfunctions and data loss. The bug reports on this topic are several years old and unanswered ( overwritten translations and overwritten ACF field labels and overwritten ACF field labels and overwritten options and global ACF option pages ). I've now taken a closer look at the problem.


The error always occurs when creating a so-called ACF options page:

ceef04e850da257a8aaa54e356199f61

To reproduce the bug, do the following. First, set the language to "German" in the menu at the top of the dashboard. Now you open the menu item "Options" twice (each in a tab). It is important here to call up the menu item directly. In the second tab you now change the language (in our example to "English"). Now make changes in the first tab and click on "Update". Now the contents of all German fields have incorrectly landed in the English fields:

The whole thing happens without warning and is particularly fatal if a large number of options are overwritten.

The following hotfix in functions.php solves the problem (don't forget to exchange "acf-options" if you use an individual slug):

ceef04e850da257a8aaa54e356199f61

Back