Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is unable to see translation icons and language assignments on their website after entering the last translation. An error message indicates an 'Uncaught InvalidArgumentException' related to the WPML plugin.
Solution:
1. Verify that active languages are declared in WPML > Languages. If no languages appear, attempt to add them again.
2. If unable to add languages, check the database for the WPML languages table. Back up the site and navigate to WPML > Support > Troubleshooting. Use the "Clear language information and repopulate languages" option.
3. If the issue persists, and the priorly set default language appears as greyed out, set another language as the site's default language. This may allow you to re-add the greyed out laguage and set it as default language.

If these steps do not resolve the issue or seem outdated, we 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 problems continue, please open 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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Andreas W. 2 months, 1 week ago.

Assisted by: Andreas W..

Author Posts
October 30, 2024 at 3:44 pm #16348205

denisR-17

Background of the issue:
I am trying to manage translations on my site hidden link. All translations have already been introduced. After the last translation was entered, suddenly all the icons with the ability to add a translation disappeared. In the options, there is no information about what language and what translation is assigned to the site. When trying to enter the settings, a message is shown: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /martamarek/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112 Stack trace: #0 [internal function]: WPMLFPObj::WPMLFP{closure}(NULL, 'code', false) #1 /martamarek/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array) #2 [internal function]: WPMLFPObj::WPMLFP{closure}(NULL, 'code', false) #3 /martamarek/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array) #4 /martamarek/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php(90): WPMLFPObj::__callStatic('propOr', Array) #5 [internal function]: WPMLFPObj::WPMLFP{closure}('code', false) #6 /martamarek/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array) #7 [ in /martamarek/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php on line 112

Symptoms:
All translation icons disappeared, and there is no information about language assignments. Error message: Uncaught InvalidArgumentException in WPML plugin.

Questions:
How can I restore the English translations I entered?

October 30, 2024 at 5:34 pm #16348776

denisR-17

I tried to reinstall the plug-in, enable and disable the plug-in - but to no avail.
The error appeared after translating the Cookie Policy page. The page is marked “Legal document, Elementor”.

October 31, 2024 at 9:04 pm #16353367

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

For some reason there is not any active language declared inside WPML > Languages.

Please add at again the languages that the site used to use before.

In case you do not get any available option whn trying to add languages, please let me know.

Best regards
Andreas

November 2, 2024 at 12:31 pm #16356707

denisR-17

I cannot add any languages. When I click on the add/remove languages button nothing is displayed (I see what is in the screenshot).

Zrzut ekranu 2024-11-2 o 13.30.08.png
November 4, 2024 at 2:17 pm #16361515

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

It looks like your database is missing the WPML languages table.

Could you please take abackup of the site and then go to WPML > Support > Troubleshooting.

Look for an option called "Clear language information and repopulate languages".

If the option is not available or the option will not solve the issue, please let me know and I will glad to take a closer look into the issue.

November 4, 2024 at 2:42 pm #16361683

denisR-17

After performing this action, I can add English language, but now I can't add Polish as the main language (it is inactive for selection from the list of languages).

Zrzut ekranu 2024-11-4 o 15.41.05.png
Zrzut ekranu 2024-11-4 o 15.39.02.png
November 4, 2024 at 2:53 pm #16361755

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

This is because it was set as site default language earlier.

Please set English as site default lanbguage. In case this will not work, at a third language in the meantime.

Once a different language than Polish is set as default language you should be able to add Polish again.

November 4, 2024 at 3:15 pm #16361831

denisR-17

Uff, now it all adds up. Thank you for your help!