Skip Navigation

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

Problem:
The client is experiencing a fatal error preventing them from editing some translated pages. The error message indicates 'InvalidArgumentException: item should be a Collection or an array or an object' in a specific file within the WPML plugin.

Solution:

Check the Admin profile setup:
- Navigate to Users > Profile and confirm that the First Name and Last Name fields are filled out correctly.
- Go to 'WPML > Translation Management > Translator' and if you have added your profile as a translator, remove it and re-add it. If you haven't configured the Translator yet, you can leave it as is.

If these solutions do not resolve the issue, 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.

This topic contains 3 replies, has 3 voices.

Last updated by Prosenjit Barman 1 year, 2 months ago.

Assisted by: Prosenjit Barman.

Author Posts
December 7, 2023 at 9:18 am #15014679

zoeyO

Hi, having an issue with one of our client sites, this error is preventing us from editing some (but not all) translated pages

Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /home/dycem/public_html/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 /home/dycem/public_html/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 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array) #4 /home/dycem/public_html/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 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array) #7 [internal function]: WPMLFPObj::WPMLFP{closure}('code', false) #8 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array) #9 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/jobs-list/class-wpml-tm-jobs-list-script-data.php(191): WPMLFPObj::__callStatic('prop', Array) #10 [internal function]: WPML_TM_Jobs_List_Script_Data->{closure}(false) #11 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Object(Closure), Array) #12 [internal function]: WPMLFP{closure}('us', 3) #13 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(321): call_user_func_array(Object(Closure), Array) #14 [internal function]: WPMLFPFns::WPMLFP{closure}('us', 3) #15 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(164): array_map(Object(Closure), Array, Array) #16 [internal function]: WPMLFPFns::WPMLFP{closure}(Object(Closure), Array) #17 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array) #18 [internal function]: WPMLFPFns::WPMLFP{closure}(Object(Closure), Array) #19 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array) #20 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/jobs-list/class-wpml-tm-jobs-list-script-data.php(177): WPMLFPFns::__callStatic('map', Array) #21 [internal function]: WPML_TM_Jobs_List_Script_Data->{closure}(Array, 'en') #22 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(603): array_map(Object(Closure), Array, Array) #23 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/jobs-list/class-wpml-tm-jobs-list-script-data.php(182): WPMLCollectSupportCollection->map(Object(Closure)) #24 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/jobs-list/class-wpml-tm-jobs-list-script-data.php(137): WPML_TM_Jobs_List_Script_Data->buildLanguagePairs(Array) #25 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Loader.php(24): WPML_TM_Jobs_List_Script_Data->get() #26 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPMLTMJobsLoader->getData(Array) #27 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(257): WPMLFPRight->map(Array) #28 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Promise.php(24): WPMLFPRight->chain(Array) #29 /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/Hooks.php(50): WPMLFPPromise->resolve(Object(WPMLFPRight)) #30 /home/dycem/public_html/wp-includes/class-wp-hook.php(324): WPMLLIBWPHooks::WPMLLIBWP{closure}('') #31 /home/dycem/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #32 /home/dycem/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #33 /home/dycem/public_html/wp-settings.php(665): do_action('wp_loaded') #34 /home/dycem/public_html/wp-config.php(90): require_once('/home/dycem/pub...') #35 /home/dycem/public_html/wp-load.php(50): require_once('/home/dycem/pub...') #36 /home/dycem/public_html/wp-admin/admin.php(34): require_once('/home/dycem/pub...') #37 {main} thrown in /home/dycem/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php on line 112
There has been a critical error on this website. Please check your site admin email inbox for instructions.

Learn more about troubleshooting WordPress.

We're using the latest version of WPML, these are our server specs
PHP
Version 8.0.30
Memory limit 512M
Memory usage 179.35 MB
Max execution time 30
Max input vars 1000
Utf8mb4 charset Yes
SimpleXML extension Loaded
Multibyte String extension Loaded
WordPress
Version 6.4.2
Multisite No
Memory limit 512M
Max memory limit 512M
REST enabled Yes

December 7, 2023 at 9:36 am #15014891

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Please reply to this ticket if you need more help with this issue.

Regards,
Itamar.

December 7, 2023 at 9:37 am #15014983

zoeyO

Hi, I deleted the database record as per the guidance but nothing changed. I also tried it with ACF Multilingual deactivated, with no success, the error has remained the same

December 7, 2023 at 12:17 pm #15016439

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
I hope you're doing well.

I checked the entire conversation you had with my colleague Itamar and understood the issue.

Based on the error log, this issue most of the time happens due to incomplete setup of the Admin profile, specifically when the First Name and Last Name fields are left empty or if the Email format is incorrect. Could you please try the following steps to see if they resolve the problem?

1. Navigate to Users > Profile and make sure you've correctly entered your First and Last name in the Profile section.
2. Next, go to "WPML > Translation Management > Translator."
3. If you've already added your profile as a translator, please remove it and then re-add it. If you haven't configured the Translator yet, you can leave it as it is.

Please check and let me know if that helps to solve the issue or if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit

December 7, 2023 at 1:16 pm #15016987

zoeyO

That did the trick, thank you for your help