[Resolved] Issue with translation not saving anymore since WPML 4.7.6
This thread is resolved. Here is a description of the problem and solution.
Problem: After updating WPML to version 4.7.6 and attempting to update the translation of a product page, the page remains stuck at 'Saving in progress.' The issue occurs when using the Classic Translation Editor, and it affects not only products but also posts and pages. Solution: We discovered that disabling the 'WC MyParcel Belgium' plugin resolves the issue. If this plugin is essential for your operations, you can apply a workaround. In the file wc-myparcel-belgium/wc-myparcel-belgium/includes/class-wcmpbe-postcode-fields.php, within the function getPostedValues(), change the line:
_ajax_wp_die_handler('Invalid nonce.');
to:
// _ajax_wp_die_handler('Invalid nonce.');
or replace it with:
if (!is_admin()) {<br /> wp_die(__('Invalid nonce.', 'woocommerce-myparcelbe'), 403);<br />}
This modification should allow WPML to save the translation. We recommend reporting these findings to the plugin's author for a permanent fix.
If this solution does not apply to your case, or if it seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If issues persist, we highly recommend opening a new support ticket 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.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
The error I mentioned earlier will only affect your site if you use the Advanced Translation Editor to create translations.
Now, on your site, I see the Classic Translation Editor is set as the default translation editor. In this case, you will not run into the earlier-mentioned error.
This time it is a different error that appears to occur when trying to save translations inside the Classic Translation Editor, and this is the case not only for the product, it also happens on posts or pages.
I can confirm the same issue on my test site.
As a workaround for the issue:
Inside the file wc-myparcel-belgium/wc-myparcel-belgium/includes/class-wcmpbe-postcode-fields.php, inside the function getPostedValues() which is located near the end of the file, change the line:
_ajax_wp_die_handler('Invalid nonce.');
into:
// _ajax_wp_die_handler('Invalid nonce.');
or as alternative, replace the line with:
if (!is_admin()) {
wp_die(__('Invalid nonce.', 'woocommerce-myparcelbe'), 403);
}
This will solve the issue, and WPML will be able to create the translation.
Finally, integrating this change would be the task for the author of the plugin, which is why I suggest you report my findings and then follow up with the author from there.
Thank you very much for the tests and for the workaround.
When you say "As a workaround for the issue, inside the function getPostedValues() which is located near the end of the file, change the line", which "file" are you talking about exactly?
Are you talking about a file inside the WC MyParcel Belgium plugin?
I will forward your findings and workaround to the MyParcel team so that they can release a new version of the plugin (because I am not a developer and I am unable to implement your change).
Do I need to say anything else to MyParcel?
And about the other issue/error you mentioned earlier (when you use the Advanced Translation Editor), is it also due to the WC MyParcel Belgium plugin?
If yes, how to solve this error and what should I say about it to MyParcel (please tell me exactly what I have to tell them because I am not a developer).
Concerning the other issues about the Translation Tools, could you please try to re-activate all plugins and see if the issue occurs again? And if yes, could you please try to check which plugin causes this error (is it still the WC MyParcel Belgium plugin maybe)?
Please de-activate all the plugins except WooCommerce and WooCommerce Stripe Payment gateway after your tests.
The WC MyParcel Belgium development team worked on a new version with a fix.
You can download it here: hidden link
Could you please install this version on my staging website and let me know if it resolves the issue?
Then, if it's ok, I will tell it to the WC MyParcel Belgium development team and they’ll release the update via the official WordPress catalogue.
Thank you very much in advance for your tests and feedback.
Apart from that, take note that there is the following issue that should be reported to WP Rocket.
Is is about their addon "Heartbeat Control by WP Rocket" and relates to the way the addon is loading the text domains for WordPress. This is not an WPML issue but can affect the WPML String Translation.
The author needs to adjust the way in which the text domain is loaded for this addon.
PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the [php]heartbeat-control
domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the
init
action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/customer/www/staging27.matcha-iro.com/public_html/wp-includes/functions.php on line 6121
[/php]