Home›Support›English Support›[Resolved] We found an issues using acfml plugin saving page options with translation preference set to copy/co...
[Resolved] We found an issues using acfml plugin saving page options with translation preference set to copy/co...
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're experiencing issues with incorrect escape values when saving option pages using the ACFML (WPML-ACF) plugin, particularly when fields are set to copy or copy-once, the script workflow may not account for the necessary unescaping before saving in other languages. Solution: We recommend updating to ACFML version 2.2.4, which includes a permanent fix for this issue. This update ensures that the
wp_unslash()
function is applied to the local value before saving, correcting the escape values across different languages.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Additionally, you can open a new support ticket for further assistance at WPML support forum.
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.
Hi, we found an issue that cause the wrong escape value saving option pages using acfml (wpml-acf) plugin.
When the field is set to copy or copy-once the script workflow does not consider the unscape needed before save other languages.
In the file acfml/classes/Options/EditorHooks.php this is the fix we need.
Using wp_unslash before the option value save.
Welcome to WPML support. Thank you for providing the information.
Unfortunately, it is not possible for us to give code suggestions that way, as each small change might have implications for other parts of the code.
We have a code testing system that needs to go through a piping process, and if it is not validated, the code change is rejected.
That is why our development team envolvment on this is necessary, and to do that, we need to replicate an actual issue lacking of the check you mentioned causes, so then I can report this alongside your code suggestion.
May I ask you what the side effects will be and how to replicate the problem so I can report?
I created a clean installation of WordPress and installed and registered WPML Multilingual CMS, WPML String Translation Advanced Custom Fields Pro, and Advanced Custom Fields Multilingual plugins.
You can access the dashboard here: hidden link
May I ask you to replicate the issue and tell me the steps to check?
Thank you Christopher
I created the Option Page with a simple textarea and use the get_field in the frontend to write the content in the head. In the screenshots attached you can find the EN page (default locale) that works and the Espanol page that is broken.
The filed is saved only once in the main localization and in others locales is saved wrongly escaped into the DB.