Skip Navigation

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

Problem:
The client is experiencing a PHP fatal error when updating translations on their WPML-powered site. The error message indicates an issue with an object expected to be a Collection, array, or object.
Solution:
Navigate to WPML > Translation Management > Jobs, order the jobs by status, and ensure no job is still assigned to a translation of a target language that no longer exists on the website. Cancel any outdated jobs.

If these steps do not resolve the issue or if the errors reoccur, the solution might be outdated or not applicable to your case. 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 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.

Tagged: 

This topic contains 4 replies, has 1 voice.

Last updated by Andreas W. 2 weeks ago.

Assisted by: Andreas W..

Author Posts
December 24, 2024 at 11:13 pm #16544718

Jasmin

Background of the issue:
I am trying to resolve errors with WPML on my site hidden link. I can't update the translation and have been following the error logs.

image 1, 2: when try to update translation

Symptoms:
PHP Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112

Questions:

December 25, 2024 at 5:16 am #16544897

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Welcome to the WPML support forum. Before passing this thread to my colleague, I would like to share some suggestions and possible solutions for the issues you mentioned.

Does it happen when you are updating all the translations? This may be related to the following errata (but it is fixed in the latest version of Advanced Custom Field Multilingual).

https://wpml.org/errata/fatal-error-uncaught-invalidargumentexception-item-should-be-a-collection-or-an-array-or-an-object-when-visiting-wpml-settings/

https://wpml.org/errata/advanced-custom-fields-extended-fatal-error-uncaught-invalidargumentexception-item-should-be-a-collection-or-an-array-or-an-object-in/

So to make sure, please deactivate the Advanced Custom Field Multilingual plugin after a full site backup and make sure the bug exists or not.

--
Thanks!

Bigul

December 28, 2024 at 1:52 am #16549661

Jasmin

hello, didn't have time to do as you advised yet. will be back.
Thanks

- Jasmin

December 28, 2024 at 8:41 am #16549764

Andreas W.
Supporter

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

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

Hello,

I will be awaiting your reply.

Please let me know if further assistance will be needed and I will be glad to have a look into the site for you.

Best regards
Andreas

January 2, 2025 at 12:49 am #16557571

Jasmin

just to keep it open..

January 2, 2025 at 2:35 pm #16559133

Andreas W.
Supporter

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

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

If you would like me to have a look into this for you, please do not hesitate to ask.

The ticket will remain open and the private reply form is enabled, so that you can provide admin access, if needed.

IMPORTANT:
Please always make sure to take a backup of your site and database before sharing access.

January 12, 2025 at 1:58 am #16585011

Andreas W.
Supporter

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

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

According to the error the problem is a translation job for which WPML can not determine the target languages. This usually happens if the target language was removed from the site.

Please go through WPML > Translation Management > Jobs.

Order the jobs by status and make sure that no job is still assigned to a translation of the target language for this job no longer exists on the website.

There are also many jobs with a deadline that passed in 2021. Please cancel any job that no longer requires a translation for now.

If this will not solve the issue, please let me know.

January 13, 2025 at 9:58 pm #16590857

Jasmin

Hello Andreas

thanks but we encountered another problem as soon as your support work on our site. We received this message (below this thread). Now the site is considered as 'not secure site' when no cache... Could you please help for this?
Thanks

Jasmin

----------------------------------------
Howdy!

WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, WPML Multilingual CMS.

First, visit your website (hidden link) and check for any visible issues. Next, visit the page where the error was caught (hidden link) and check for any visible issues.

Please contact your host for assistance with investigating this issue further.

If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.

hidden link

To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.7.1
Active theme: Hello Elementor Child (version 1.0.1)
Current plugin: WPML Multilingual CMS (version 4.6.15)
PHP version 8.1.30

Error Details
=============
An error of type E_ERROR was caused in line 112 of the file /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php. Error message: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112
Stack trace:
#0 [internal function]: WPML\FP\Obj::WPML\FP\{closure}(NULL, 'code', false)
#1 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)
#2 [internal function]: WPML\FP\Obj::WPML\FP\{closure}(NULL, 'code', false)
#3 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array)
#4 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php(90): WPML\FP\Obj::__callStatic('propOr', Array)
#5 [internal function]: WPML\FP\Obj::WPML\FP\{closure}('code', false)
#6 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)
#7 [internal function]: WPML\FP\Obj::WPML\FP\{closure}('code', false)
#8 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array)
#9 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/classes/menu/jobs-list/class-wpml-tm-jobs-list-script-data.php(197): WPML\FP\Obj::__callStatic('prop', Array)
#10 [internal function]: WPML_TM_Jobs_List_Script_Data->{closure}(false)
#11 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Object(Closure), Array)
#12 [internal function]: WPML\FP\{closure}('fp', 9)
#13 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(321): call_user_func_array(Object(Closure), Array)
#14 [internal function]: WPML\FP\Fns::WPML\FP\{closure}('fp', 9)
#15 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(164): array_map(Object(Closure), Array, Array)
#16 [internal function]: WPML\FP\Fns::WPML\FP\{closure}(Object(Closure), Array)
#17 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)
#18 [internal function]: WPML\FP\Fns::WPML\FP\{closure}(Object(Closure), Array)
#19 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array)
#20 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/classes/menu/jobs-list/class-wpml-tm-jobs-list-script-data.php(183): WPML\FP\Fns::__callStatic('map', Array)
#21 [internal function]: WPML_TM_Jobs_List_Script_Data->{closure}(Array, 'en')
#22 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(603): array_map(Object(Closure), Array, Array)
#23 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/classes/menu/jobs-list/class-wpml-tm-jobs-list-script-data.php(188): WPML\Collect\Support\Collection->map(Object(Closure))
#24 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/classes/menu/jobs-list/class-wpml-tm-jobs-list-script-data.php(143): WPML_TM_Jobs_List_Script_Data->buildLanguagePairs(Array)
#25 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Loader.php(24): WPML_TM_Jobs_List_Script_Data->get()
#26 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPML\TM\Jobs\Loader->getData(Array)
#27 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(257): WPML\FP\Right->map(Array)
#28 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Promise.php(24): WPML\FP\Right->chain(Array)
#29 /www/raelorgi_146/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/Hooks.php(50): WPML\FP\Promise->resolve(Object(WPML\FP\Right))
#30 /www/raelorgi_146/public/wp-includes/class-wp-hook.php(324): WPML\LIB\WP\Hooks::WPML\LIB\WP\{closure}('')
#31 /www/raelorgi_146/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#32 /www/raelorgi_146/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#33 /www/raelorgi_146/public/wp-settings.php(726): do_action('wp_loaded')
#34 /www/raelorgi_146/public/wp-config.php(49): require_once('/www/raelorgi_1...')
#35 /www/raelorgi_146/public/wp-load.php(50): require_once('/www/raelorgi_1...')
#36 /www/raelorgi_146/public/wp-admin/admin.php(34): require_once('/www/raelorgi_1...')
#37 {main}
thrown

January 14, 2025 at 3:46 pm #16593824

Andreas W.
Supporter

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

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

The translation queue is now available on your site.

If the errors reoccur, please let me know.