This thread is resolved. Here is a description of the problem and solution.
Problem:
When trying to edit an existing translation or add a translation you get a critical error on the site.
Solution:
- Go to WPML -> Translation Management -> Translators
- Click on the Pencil/Edit icon beside the user you want to edit the translation as.
- Make sure to assign the correct language pair and save.
Trying to edit any translation gives a WP critical error. Errors with debugging turned on is:
[12-Aug-2023 16:22:39 UTC] PHP Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /home/petoxy-ojbiub12f/webapps/Petoxygen-hk/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112
Before your ticket is assigned to one of my colleagues, I will try to help.
Can you please first create a full website backup and then try the recommendation of my colleagues from the top 5-7 existing ticket results in the custom search URL I created for you below:
I've tried some of the solutions there including:
- Set the theme to WP default
- Deactivated ALL plugins except for WPML
- Deleted all WPML plugins and then downloaded and reinstalled from the WPML website.
Please can you escalate as I don't know what else to try.
Since you haven't shared the site debug info I am not able to check your site settings. But from the error, It seems like the error is being caused due to a known error with an older version of the WPML String translation plugin as explained in the erratum linked next:
Please check and confirm if you are using the latest version of WPML plugins on the site from wp-admin -> Plugins -> Add New -> Commercial ( tab )
If the issue is still there with the latest version of WPML plugins, I would need to take a closer look at your site. So would you please mind sharing temporary access (WP-Admin and FTP) to your site? Preferably to a test site where the problem has been replicated. Also, please let me know the exact steps/process for me to see/replicate the issue on the site at my end.
I have enabled a private reply for you to share the credentials securely, which means only you and I have access to it.
IMPORTANT: Please take a complete backup of the site first to avoid data loss.
✙ I would additionally need your permission to make a copy of the site with plugins like Duplicator and deploy it on my local machine to test the issue further.
After troubleshooting the issue further it seems like the Language pairs were not correctly assigned to the user for translation and that was causing the issue.
To fix the issue in your live site please go to WPML -> Translation Management -> Translators then click on the Pencil/Edit icon beside the use you want to edit the translation as and make sure to assign the correct language pair and save.