Mukti Mistry
I am trying to translate posts from Spanish to English using WPML but got the error 'There has been a critical error on this site.' Multiple users faced this issue. After some hours, I checked and translated the post, and it is now working. I want to know the root cause because this is happening frequently. We have checked the server logs, and it is caused by the WPML plugin.
Error logs :
PHP Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112\nStack trace:\n#0 [internal function]: WPML\\FP\\Obj::WPML\\FP\\{closure}(NULL, 'ate_job_id', '3428a8b04d62453...')\n#1 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)\n#2 [internal function]: WPML\\FP\\Obj::WPML\\FP\\{closure}(NULL, 'ate_job_id', '3428a8b04d62453...')\n#3 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array)\n#4 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php(90): WPML\\FP\\Obj::__callStatic('propOr', Array)\n#5 [internal function]: WPML\\FP\\Obj::WPML\\FP\\{closure}('ate_job_id', '3428a8b04d62453...', 'cw_request_id')\n#6 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)\n#7 [internal function]: WPML\\FP\\{closure}('3428a8b04d62453...', 'cw_request_id')\n#8 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Object(Closure), Array)\n#9 [internal function]: WPML\\FP\\{closure}('3428a8b04d62453...', 'cw_request_id')\n#10 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Arr.php(147): call_user_func(Object(Closure), '3428a8b04d62453...', 'cw_request_id')\n#11 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(386): WPML\\Collect\\Support\\Arr::first(Array, Object(Closure), NULL)\n#12 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/API/ATE.php(37): WPML\\Collect\\Support\\Collection->first(Object(Closure))\n#13 [internal function]: WPML\\TM\\API\\ATE->checkJobStatus('8802')\n#14 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Array, Array)\n#15 [internal function]: WPML\\FP\\{closure}('8802')\n#16 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Object(Closure), Array)\n#17 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(148): WPML\\FP\\{closure}(Object(stdClass))\n#18 [internal function]: WPML\\FP\\Fns::WPML\\FP\\{closure}(Object(Closure), 2)\n#19 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(164): array_map(Object(Closure), Array, Array)\n#20 [internal function]: WPML\\FP\\Fns::WPML\\FP\\{closure}(Object(Closure), Array)\n#21 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)\n#22 [internal function]: WPML\\FP\\Fns::WPML\\FP\\{closure}(Object(Closure), Array)\n#23 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array)\n#24 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(150): WPML\\FP\\Fns::__callStatic('map', Array)\n#25 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Maybe.php(144): WPML\\FP\\Fns::WPML\\FP\\{closure}(Object(stdClass))\n#26 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/classes/ATE/REST/PublicReceive.php(84): WPML\\FP\\Just->chain(Object(Closure))\n#27 /nas/content/live/vozmedia/wp-includes/rest-api/class-wp-rest-server.php(1188): WPML\\TM\\ATE\\REST\\PublicReceive->receive_ate_job(Object(WP_REST_Request))\n#28 /nas/content/live/vozmedia/wp-includes/rest-api/class-wp-rest-server.php(1035): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wpml/tm/v1/ate...', Array, NULL)\n#29 /nas/content/live/vozmedia/wp-includes/rest-api/class-wp-rest-server.php(447): WP_REST_Server->dispatch(Object(WP_REST_Request))\n#30 /nas/content/live/vozmedia/wp-includes/rest-api.php(418): WP_REST_Server->serve_request('/wpml/tm/v1/ate...')\n#31 /nas/content/live/vozmedia/wp-includes/class-wp-hook.php(310): rest_api_loaded(Object(WP))\n#32 /nas/content/live/vozmedia/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters('', Array)\n#33 /nas/content/live/vozmedia/wp-includes/plugin.php(565): WP_Hook->do_action(Array)\n#34 /nas/content/live/vozmedia/wp-includes/class-wp.php(398): do_action_ref_array('parse_request', Array)\n#35 /nas/content/live/vozmedia/wp-includes/class-wp.php(779): WP->parse_request('')\n#36 /nas/content/live/vozmedia/wp-includes/functions.php(1335): WP->main('')\n#37 /nas/content/live/vozmedia/wp-blog-header.php(16): wp()\n#38 /nas/content/live/vozmedia/index.php(17): require('/nas/content/li...')\n#39 {main}\n thrown in /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php on line 112.
Error log:
PHP Fatal error: Uncaught Error: Call to a member function get_source_language_code() on bool in /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php:497\nStack trace:\n#0 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Hooks/class-wpml-tm-ate-jobs-actions.php(153): wpml_tm_create_ATE_job_creation_model('8787', true)\n#1 [internal function]: WPML_TM_ATE_Jobs_Actions->{closure}('8787', 0)\n#2 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(164): array_m
Bobby
WPML Supporter since 04/2015
Languages:
English (English )
Timezone:
America/Los_Angeles (GMT-07:00)
Hello,
Please try the following:
- Make a full backup of your site before proceeding.
- Open your database.
- Look for the wp_options table.
- Find the icl_sitepress_settings key.
- Remove it.
- Run again the setup process.
Let me know your results, please.
Mukti Mistry
Hi Bobby, i have tried above steps provided still we are facing same issue
Error logs:
PHP Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112\nStack trace:\n#0 [internal function]: WPML\\FP\\Obj::WPML\\FP\\{closure}(NULL, 'ate_job_id', 'b9aa68786be2424...')\n#1 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)\n#2 [internal function]: WPML\\FP\\Obj::WPML\\FP\\{closure}(NULL, 'ate_job_id', 'b9aa68786be2424...')\n#3 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array)\n#4 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php(90): WPML\\FP\\Obj::__callStatic('propOr', Array)\n#5 [internal function]: WPML\\FP\\Obj::WPML\\FP\\{closure}('ate_job_id', 'b9aa68786be2424...', 'cw_request_id')\n#6 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)\n#7 [internal function]: WPML\\FP\\{closure}('b9aa68786be2424...', 'cw_request_id')\n#8 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Object(Closure), Array)\n#9 [internal function]: WPML\\FP\\{closure}('b9aa68786be2424...', 'cw_request_id')\n#10 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Arr.php(147): call_user_func(Object(Closure), 'b9aa68786be2424...', 'cw_request_id')\n#11 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(386): WPML\\Collect\\Support\\Arr::first(Array, Object(Closure), NULL)\n#12 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/API/ATE.php(37): WPML\\Collect\\Support\\Collection->first(Object(Closure))\n#13 [internal function]: WPML\\TM\\API\\ATE->checkJobStatus('8979')\n#14 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Array, Array)\n#15 [internal function]: WPML\\FP\\{closure}('8979')\n#16 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Object(Closure), Array)\n#17 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(148): WPML\\FP\\{closure}(Object(stdClass))\n#18 [internal function]: WPML\\FP\\Fns::WPML\\FP\\{closure}(Object(Closure), 2)\n#19 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(164): array_map(Object(Closure), Array, Array)\n#20 [internal function]: WPML\\FP\\Fns::WPML\\FP\\{closure}(Object(Closure), Array)\n#21 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)\n#22 [internal function]: WPML\\FP\\Fns::WPML\\FP\\{closure}(Object(Closure), Array)\n#23 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array)\n#24 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(150): WPML\\FP\\Fns::__callStatic('map', Array)\n#25 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Maybe.php(144): WPML\\FP\\Fns::WPML\\FP\\{closure}(Object(stdClass))\n#26 /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/classes/ATE/REST/PublicReceive.php(84): WPML\\FP\\Just->chain(Object(Closure))\n#27 /nas/content/live/vozmedia/wp-includes/rest-api/class-wp-rest-server.php(1188): WPML\\TM\\ATE\\REST\\PublicReceive->receive_ate_job(Object(WP_REST_Request))\n#28 /nas/content/live/vozmedia/wp-includes/rest-api/class-wp-rest-server.php(1035): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wpml/tm/v1/ate...', Array, NULL)\n#29 /nas/content/live/vozmedia/wp-includes/rest-api/class-wp-rest-server.php(447): WP_REST_Server->dispatch(Object(WP_REST_Request))\n#30 /nas/content/live/vozmedia/wp-includes/rest-api.php(418): WP_REST_Server->serve_request('/wpml/tm/v1/ate...')\n#31 /nas/content/live/vozmedia/wp-includes/class-wp-hook.php(310): rest_api_loaded(Object(WP))\n#32 /nas/content/live/vozmedia/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters('', Array)\n#33 /nas/content/live/vozmedia/wp-includes/plugin.php(565): WP_Hook->do_action(Array)\n#34 /nas/content/live/vozmedia/wp-includes/class-wp.php(398): do_action_ref_array('parse_request', Array)\n#35 /nas/content/live/vozmedia/wp-includes/class-wp.php(779): WP->parse_request('')\n#36 /nas/content/live/vozmedia/wp-includes/functions.php(1335): WP->main('')\n#37 /nas/content/live/vozmedia/wp-blog-header.php(16): wp()\n#38 /nas/content/live/vozmedia/index.php(17): require('/nas/content/li...')\n#39 {main}\n thrown in /nas/content/live/vozmedia/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php on line 112
Bobby
WPML Supporter since 04/2015
Languages:
English (English )
Timezone:
America/Los_Angeles (GMT-07:00)
Thank you for updating me!
Please try this:
- Create a new admin user
- Login using the new account
Can you reproduce the issue now?
Mukti Mistry
Hi Bobby,
Users with admin roles are not experiencing any issues. They have tried two to three times, and it is working properly for them. However, users with editor roles are facing the issue occasionally. I have checked the error log for today, and the above error occurred 4 to 5 times.
Bobby
WPML Supporter since 04/2015
Languages:
English (English )
Timezone:
America/Los_Angeles (GMT-07:00)
I see, thannk you for updating me about this!
Is this happening for all editors then? In the past I have seen this happen when a role has been corrupted in the database.
What are your results if you create a new editor role does it work ok?
For example what we have seen is this --- a corrupted editor role or admin role will get this error while another one will work as expected.
Mukti Mistry
Hi Bobby,
Is this happening for all editors?
--- No, not for all editors. Most of them can translate but few of them getting issue, I can still see the error posted above 2 to 4 times.
What are your results if you create a new editor role? Does it work okay?
--- Changing the user role is very difficult for us because there are multiple users with editor roles. Can you tell me the next steps if changing the role doesn't work? Also, could you exactly tell me what a corrupted role is and why it's happening?
Thanks.
Bobby
WPML Supporter since 04/2015
Languages:
English (English )
Timezone:
America/Los_Angeles (GMT-07:00)
Thank you for updating me!
You would not change the editor role instead you would have to create a brand new user and assign to that new user the editor role then it should work as expected.
essentially what I meant is that the user is most likely corrupted.
If this is not an applicable workaround solution the next step would be for us to take a closer look at the backend and database which can take a bit longer thus the above workaround which is a faster solution.