[Resolved] Database appear broken when activating WPML
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is facing issues with reactivating WPML on their website after a rebuild. The main problems include a database error stating 'We have detected a problem with some tables in the database,' no languages appearing in WPML -> Languages, and inability to add languages manually. Solution: We recommend resetting WPML and then reinstalling it. Here are the steps to follow: 1. Go to WPML -> Support -> Troubleshooting. 2. Scroll down to find the 'WPML Reset' option and use it to reset WPML. 3. Reinstall WPML with a fresh download. These steps were tested on a staging site and resolved the issues. If you're experiencing this, we recommend trying these steps on your live site.
Please note that this solution might be outdated or not applicable to your specific case. If these steps do not resolve your issue, 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. If the problem persists, please open a new support ticket with us for further assistance.
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 have a website that used to be bilingual (FR and EN) before we did a rebuild in 2022, but kept only FR and deactivated WPML. Today, we want to reactivate WPML, but I got an error with the following message: 'We have detected a problem with some tables in the database. Please contact WPML support to get this fixed.' Also, when going to WPML -> Languages, no language appears at all, and when trying to add them manually, nothing works as it should. I created this staging just for you to help, but when you'll have a solution, I will need to know what to do, because I won't be able to simply push that staging. WordPress database error: Could not perform query because it contains invalid data. Array ( [language] => fr [context] => admin_texts_wpseo_titles [gettext_context] => [domain_name_context_md5] => 2476ea778a362cacbfea45d366f8cd81 [name] => [wpseo_titles]title-author-wpseo [value] => %%name%%, Auteur à %%sitename%% %%page%% [status] => 0 [translation_priority] => optional [allow_empty_value] => 1 )
Symptoms:
Database appears broken when activating WPML. Error message: 'We have detected a problem with some tables in the database. Please contact WPML support to get this fixed.' No languages appear in WPML -> Languages, and adding them manually does not work.
Questions:
How can I fix the database tables issue when reactivating WPML?
Why are no languages appearing in WPML -> Languages?
What steps should I follow to ensure the staging changes can be applied to the live site?
I reviewd some of your pages and it looks like some of the content is coming from templates. Please make sure you are translating both the page and the templates (both are translated the same way).
If after that you are stil seeing pages/templates with missing content in the WPML Translation Editor, please try the following steps in exact order:
1. Go to WPML -> Translation Management -> Translation Jobs and cancel the in progress job. If there is no in progress job, continue to the next steps.
2. Edit the default page. Make any small change and update the page.
3. Go to WPML -> Translation Management and send this page to the translation basket. Tick the checkbox, scroll down and click translate, then you will see the translation basket tab.
4. Click the translation basket and send the page to yourself as a translator.
5. Go to WPML -> Translations and take and translate the page. Save the translation 100% and then let's see if the correct content shows.
1- I translated some of the templates, like the Header, Footer and so on, but even there, on the template title and url are translatable. Nothing related to Elementor is showing in the translator.
2- You tell me to go see "Translation Management -> Translation Jobs", but as I mentionned in the previous chat, this Tab is surprisingly not showing !
Thanks to test it on your side, and tell me what you think ...
I found that your database was missing two tables, the icl_string_packages and the icl_mo_files_domains tables. I added those manually using the Adminer plugin, ran the troubleshooting steps in WPML -> Support -> Troubleshooting and then followed the steps to edit a page and resend it to translation. After that, I can see all the content in the translation editor and the Jobs tab in the WPML -> Translation Management dashboard.
Feel free to test a few pages by making updates and sending to translation and let me know if you run into any other problems.
That's better, but still not fully working.
Page are translating ok, but there is problems with templates translation:
Template seem to translate, ans saved. But on page reload, the page in the second language disappear !
Here is an example with the footer: hidden link
Also, I would like to know if it would be possible to totally reset WPML on this website, and on your servers, just like it was never installed. I'm asking that because I see that we are trying to repair and we both take a lot of time, and I'm afraid that in the futur, I will constantly be facing problems of any sorts because we're just repairing ! and in fact, I wouldn't care at all at this stage to start over from scratch.
On the test site, I was able to reset WPML and then install a fresh download and it seems to be working as expected, there were no missing columns. Please feel free to use this test site and see if you can find any issues, and if not, I think it's safe for you to follow these same steps on the live site. The WPML Reset is in WPML -> Support -> Troubleshooting and it's towards the bottom of the page.