Skip Navigation

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

Problem:
The client encountered a fatal error in the 'translate custom fields' section within 'WPML > Settings'. The error prevented rendering of sections below it and was resolved by disabling the 'Advanced Custom Fields Multilingual' plugin.
Solution:
We are aware of this issue and our developers are currently working on a fix. In the meantime, we recommend following the workaround provided in our errata page: https://wpml.org/errata/fatal-error-uncaught-invalidargumentexception-item-should-be-a-collection-or-an-array-or-an-object-when-visiting-wpml-settings/.

Please note that this solution may become outdated or might not apply to your case. If the issue persists, we encourage you to open a new support ticket. We also 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.

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 1 reply, has 2 voices.

Last updated by Mihai Apetrei 1 year, 1 month ago.

Assisted by: Mihai Apetrei.

Author Posts
April 12, 2024 at 12:00 pm #15512766

frankB-3
Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112

This error displays at the bottom of the 'translate custom fields' section in 'wpml > settings'. It is unable to render the sections below it due to this error.

When i disable "advanced custom fields multilingual" the error is removed.

Please note:
The provided debug info may include 'memory limit: 40'. This appears incorrect- both the server and phpinfo display 128M as the memory limit.

Full error:

Stack trace: #0 [internal function]: WPML\FP\Obj::WPML\FP\{closure}(10099, 'title', false) #1 /home/redacted/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]: WPML\FP\Obj::WPML\FP\{closure}(10099, 'title', false) #3 /home/redacted/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/redacted/public_html/wp-content/plugins/acfml/classes/FieldGroup/SettingsLockHooks.php(52): WPML\FP\Obj::__callStatic('propOr', Array) #5 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(17): ACFML\FieldGroup\SettingsLockHooks->renderCustomFieldLock(false, Object(WPML_Post_Custom_Field_Setting)) #6 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPML\FP\{closure}(Array) #7 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(257): WPML\FP\Right->map(Object(Closure)) #8 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Promise.php(24): WPML\FP\Right->chain(Object(Closure)) #9 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/Hooks.php(50): WPML\FP\Promise->resolve(Object(WPML\FP\Right)) #10 /home/redacted/public_html/wp-includes/class-wp-hook.php(324): WPML\LIB\WP\Hooks::WPML\LIB\WP\{closure}(false, Object(WPML_Post_Custom_Field_Setting)) #11 /home/redacted/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(false, Array) #12 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/mcsetup/class-wpml-tm-mcs-custom-field-settings-menu.php(268): apply_filters('wpml_custom_fie...', false, Object(WPML_Post_Custom_Field_Setting)) #13 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/mcsetup/class-wpml-tm-mcs-custom-field-settings-menu.php(135): WPML_TM_MCS_Custom_Field_Settings_Menu->render_body() #14 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/wpml-tm-menus-settings.php(681): WPML_TM_MCS_Custom_Field_Settings_Menu->render() #15 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/wpml-tm-menus-settings.php(601): WPML_TM_Menus_Settings->build_content_mcs_custom_fields() #16 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/wpml-tm-menus.class.php(101): WPML_TM_Menus_Settings->build_content_mcs() #17 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/wpml-tm-menus.class.php(119): WPML_TM_Menus->build_content() #18 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/wpml-tm-menus-settings.php(95): WPML_TM_Menus->render_items() #19 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/wpml-tm-menus.class.php(27): WPML_TM_Menus_Settings->render_main() #20 /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-translation-management.php(406): WPML_TM_Menus->display_main() #21 /home/redacted/public_html/wp-includes/class-wp-hook.php(324): WPML_Translation_Management->settings_page('') #22 /home/redacted/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #23 /home/redacted/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #24 /home/redacted/public_html/wp-admin/admin.php(259): do_action('wpml_page_tm/me...') #25 {main} thrown in /home/redacted/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php on line 112
April 12, 2024 at 2:09 pm #15513188

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

This seems to be a known issue that our devs are already working on.

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

That workaround should help you resolve this for now.

I hope that you will find this information helpful. 🙂

Mihai Apetrei