[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.
Background of the issue:
I updated WPML to version 4.7.6 and attempted to update the translation of a product page. I clicked on the round 'arrows' to update the translation, checked 'Translation complete,' and clicked 'Save and close.' However, the page remains stuck at 'Saving in progress.' The issue can be seen on the Dutch translated page: hidden link. I expected to see the Dutch translation on this page.
Symptoms:
The page stays blocked at 'Saving in progress,' and the majority of the Dutch page content disappeared from the website.
Questions:
Why is the translation not saving after updating to WPML 4.7.6?
How can I restore the missing content on the Dutch page?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Hello,
I would like to offer to take a closer look and request for temporary access (wp-admin and FTP) to the website to investigate the issue further.
You can find the required fields below the comments section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.
IMPORTANT
Please be sure to back up your website and database before granting us access.
If you can't see the "wp-admin / FTP" fields, your post and website credentials will be set to "PUBLIC." DO NOT publish the data unless you see the required wp-admin / FTP fields.
The private reply form looks like this: hidden link
Click "I still need assistance" the next time you reply.
Video: hidden link
Please note that we are required to request this information individually on each ticket. We are not permitted to access any credentials that were not specifically submitted on this ticket using the private response form.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
The issues disappears once I disable the plugin "WC MyParcel Belgium".
Please confirm if this plugin is essential for you site to operate and we can take further steps from there.
The odd thing is until now I do not see any error on the browser's debug.log or inside the debug.log of WordPress that could clarify where this error exactly occurs.
Further, it might become difficult recreating this issue, as this requieres a Parcel's API key and PArcels does not appear to offer a free plan that we could use for testing or development purposes: hidden link
If you can provide the API key for testing, I can offer a WPML test site which we can use for testing. This way we could confirm if this is a general issue.
The "WC MyParcel Belgium" plugin is essential for my site to operate because it allows me to create shipping labels for the WooCommerce orders.
It is strange that this plugin would interfere with WPML.
I will ask the "WC MyParcel Belgium" team if they can provide you with an API key for testing.
I asked the "WC MyParcel Belgium" team to provide an API key so that you can make tests and find exactly where the problem is coming from but I'm still waiting for their reply. I think that they should reply on Monday.
I will keep you posted.
In a first instance, could you please test on your test site if you also have this issue with version 4.5.5 beta of the WC MyParcel Belgium plugin (which was the version installed on my website before updating to version 4.5.9)?
Here is the link to download version 4.5.5 beta: hidden link
I am still waiting for the free test API key so that you can make more tests with version 4.5.9 afterwards.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
At the moment, I do not have any issues with translating products on the sandbox.
Here a translated product: hidden link
Without an API key, it might not be possible to replicate this. Further, I am not familiar with the setup and usage of this plugin, which is why I would like to ask you to try to replicate the issue yourself once an API key is available.
Make sure to apply the same plugin settings between your site and the sandbox once the plugin is connected to its API.
If you would like to give it a test with a prior version of the plugin and you have this version available, please feel free to use the sandbox for testing.
I received an answer for the API key from MyParcel and the say:
"The usage of our API is completely free. They can create an account on hidden link and just test with that API key.
Nothing will be charged unless they actually use that shipping label.
They can also always contact me directly via support@sendmyparcel.be, of course I'll be happy to help!".
So please create an API key for you (it's free, you were on the wrong website when you tried to create one) and please make tests on your sandbox.
I am not a developer and I can't test myself.
Please make tests with version 4.5.9 of the WC MyParcel Belgium plugin (= the latest one) and with version 4.5.5 beta.
Thank you in advance for keeping me posted on the results on your tests.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
I was able to connect with an API key and made sure to use the same plugin settings as on your staging site. I am using the latest version of WC MyParcel Belgium.
I am about to create a few test products and send them to automatic translation using a Dummy engine.
The translations were not completed, and the "WC MyParcel Belgium" plugin is causing an error on WPML > Translation Management > Translation Tools.
Error:
There is a problem connecting to the automatic translation. Please check your internet connection and try again in a few minutes. If you continue to see this message, please contact our support team.
On the browser's debug console, I see the following JavaScript Error:
wp-auth-check.min.js?ver=6.8.1:2
Uncaught TypeError: Cannot read properties of undefined (reading 'hasClass')
at HTMLDocument.<anonymous> (wp-auth-check.min.js?ver=6.8.1:2:655)
at HTMLDocument.dispatch (load-scripts.php?c=1…s&ver=6.8.1:2:40035)
at v.handle (load-scripts.php?c=1…s&ver=6.8.1:2:38006)
at Object.trigger (load-scripts.php?c=1…s&ver=6.8.1:2:70124)
at HTMLDocument.<anonymous> (load-scripts.php?c=1…s&ver=6.8.1:2:70726)
at ce.each (load-scripts.php?c=1…ks&ver=6.8.1:2:3129)
at e.<computed>.each (load-scripts.php?c=1…ks&ver=6.8.1:2:1594)
at e.<computed>.trigger (load-scripts.php?c=1…s&ver=6.8.1:2:70701)
at Object.<anonymous> (heartbeat.min.js?ver=6.8.1:2:2186)
at c (load-scripts.php?c=1…s&ver=6.8.1:2:25304)
This is caused by one of the authorization scripts from WordPress itself:
/wp-includes/js/wp-auth-check.min.js?ver=6.8.1
I am suspecting the authorization methods of WPML and WC MyParcel Belgium are somehow generating a conflict here.
---
To confirm the issue, on your staging site:
I see currently the following message:
Le plugin WPML ne peut pas se connecter à wpml.org
Please register WPML on your staging site and update all plugins, so that we continue with testing.
I created the key for the staging website but I don't understand where to put it.
I went to Plugins > Add new on the commercial tab and I see that WPML is registered on this site so I don't know where to put the key (see attached screenshot)?
Please explain.