Skip Navigation

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 8 replies, has 3 voices.

Last updated by isotrope 7 months ago.

Assigned support staff: Bruno Kos.

Author Posts
March 16, 2021 at 8:18 pm #8325621

svenH-12

I am trying to:
Reset the cache for all languages via WP Rocket.
Everything worked before the recent WordPress and WPML upgrades.
I have also sent the failure message to WP Rocket

When deleting the cache from the main WP Rocket dashboard then all works
Also deleting language after language does not show any mistake

Link to a page where the issue can be seen:
hidden link

I expected to see:

Instead, I got:

Here is the failure message

Fatal error: Uncaught TypeError: Argument 1 passed to WPML\Element\API\Languages::WPML\Element\API\{closure}() must be of the type array, bool given in /..... /LiveTube/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/core-api/core/Languages.php:205 Stack trace: #0 [internal function]: WPML\Element\API\Languages::WPML\Element\API\{closure}(false) #1 ...... /LiveTube/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(152): call_user_func_array(Object(Closure), Array) #2 [internal function]: WPML\Element\API\Languages::WPML\FP\{closure}(false) #3 ........ /LiveTube/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array) #4 ...../LiveTube/wp-content/plugins/sitepress-multilingual-cms/classes/user-language/class-wpml-user-language.ph in ...../LiveTube/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/core-api/core/Languages.php on line 205
There has been a critical error on this website. Please check your site admin email inbox for instructions.

Learn more about troubleshooting WordPress.

March 17, 2021 at 10:48 am #8330655

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

Can you tell me if you see the problem here?
hidden link

I installed and activated WP Rocket here, I am not sure I see the error?

If you don't see the issue there, can you please check on your site if this issue appears when:

- only WPML plugins and WP Rocket plugins are activated, as it will tell us if there is an interaction issue with other plugin
- theme is set to a WordPress default like Twenty Nineteen as it will tell us if there is an interaction issue with your theme

If you find that the issue is no longer there, then I suggest you activate the theme first and check if the issue is still happening. If still all working well, then there is possibly some compatibility problem with any of your plugins, so you can for example activate 3 plugins at a time and observe the problem then.

Please make a full site backup before testing this way.

You can use plugins such as UpdraftPlus WordPress Backup Plugin (https://wordpress.org/plugins/updraftplus/) or ask your host to perform a site backup.

Let us know if you have any questions!

Regards,
Bruno Kos

March 20, 2021 at 1:16 pm #8357933

svenH-12

Hi Bruno

Thanks for looking into the issue.

- Your Sandbox version is working for me
- Change of Theme did not change the issue
- We also deactivated some of our recent new plugins but without success
- Also we deactivated AMP again which we just installed last week

Update:
We have been investigating the issue further with WP Rocket
It looks like that It is tight to the user management and the user database.

We face the problem when I am logged in as the admin.
When I provided another username to WP Rocket everything works
Also when I log in with another user then things work

I have cleared the WPML caches and rebuilt the WPML database but this still did not solve the problem,

Any idea what could cause the fatal error related to a specific user only?

For info: We run a forum with own cache and user management. But I had it deactivated also deactivated MyCred and other user plugins. But we still face the same problem.

Just to add: When we deactivate the WPML plugin then everything works,
So the findings:

- Problem WPML with WP Rocket
- Specific User only

So it seems

- Conflict WPML and WP Rocket
- Specific user only

What do you suggest as next steps

Best
Sven

March 21, 2021 at 12:51 pm #8362163

svenH-12

We found the issue. It is in conjunction with default language and admin language in WPML. When the admin language is not set to default, then it causes the fatal error. You might want to reproduce this in order to prevent other users to run into the same issue.

Screen Shot 2021-03-21 at 12.49.13.png
March 21, 2021 at 2:11 pm #8362299

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I changed user language to non-default on hidden link, but not sure I still see the error, do you?

If not, then it would not be a compatibility but site-specific problem, something we would need to investigate.

Regards,
Bruno Kos

March 21, 2021 at 2:19 pm #8362305

svenH-12

Yes I could replicate this.
Not every admin runs into the problem.
It is related to the WPML roles (capabilities) set.
See my roles here, perhaps this helps you to replicate

Screen Shot 2021-03-21 at 14.18.45.png
March 21, 2021 at 3:05 pm #8362535

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I am not sure this is reproducible in clean setup:
hidden link

try accessing this site with:
wpml / otgs

It has all these roles but I am still not seeing it.

If not able to reproduce this here, let me know so that we can proceed through Duplicator approach (will provide details).

Regards,
Bruno Kos

March 24, 2021 at 2:05 pm #8390433

isotrope

If it's any help, I'm running into the same (or similar) problem.
Also have my profile set to the site's non-default language.

Fatal error: Uncaught TypeError: Argument 1 passed to WPML\Element\API\Languages::WPML\Element\API\{closure}() must be of the type array, bool given in D:\__customers\customer\dev-michal\app\public\wp-content\plugins\sitepress-multilingual-cms\vendor\wpml\core-api\core\Languages.php on line 205
( ! ) TypeError: Argument 1 passed to WPML\Element\API\Languages::WPML\Element\API\{closure}() must be of the type array, bool given in D:\__customers\{customer}\dev-michal\app\public\wp-content\plugins\sitepress-multilingual-cms\vendor\wpml\core-api\core\Languages.php on line 205
Call Stack
#	Time	Memory	Function	Location
1	0.8150	425792	{main}( )	...\edit.php:0
2	0.8151	427040	require_once( 'D:\__customers\{customer}\dev-michal\app\public\wp-admin\admin.php' )	...\edit.php:10
3	0.8152	427680	require_once( 'D:\__customers\{customer}\dev-michal\app\public\wp-load.php' )	...\admin.php:34
4	0.8153	428152	require_once( 'D:\__customers\{customer}\dev-michal\app\public\wp-config.php' )	...\wp-load.php:37
5	0.8154	438560	require_once( 'D:\__customers\{customer}\dev-michal\app\public\wp-settings.php' )	...\wp-config.php:104
6	1.0603	14243664	do_action( )	...\wp-settings.php:423
7	1.0603	14244040	WP_Hook->do_action( )	...\plugin.php:484
8	1.0603	14244040	WP_Hook->apply_filters( )	...\class-wp-hook.php:316
9	1.1970	15861552	SitePress->init( )	...\class-wp-hook.php:292
10	1.2024	15994856	SitePress->maybe_set_this_lang( )	...\sitepress.class.php:396
11	1.2030	15994880	WPML\Language\Detection\Backend->set_language_cookie( )	...\sitepress.class.php:568
12	1.2030	15994976	WPML\Language\Detection\CookieLanguage->set( )	...\wpml-request.class.php:110
13	1.2030	15995672	do_action( )	...\CookieLanguage.php:83
14	1.2030	15996048	WP_Hook->do_action( )	...\plugin.php:484
15	1.2030	15996048	WP_Hook->apply_filters( )	...\class-wp-hook.php:316
16	1.2030	15997176	WPML_User_Language->update_user_lang_on_cookie_update( )	...\class-wp-hook.php:292
17	1.2085	15966080	WPML\Element\API\Languages::getWPLocale( )	...\class-wpml-user-language.php:200
18	1.2085	15966456	WPML\Element\API\Languages::__callStatic( )	...\class-wpml-user-language.php:200
19	1.2085	15967248	call_user_func_array:{D:\__customers\{customer}\dev-michal\app\public\wp-content\plugins\sitepress-multilingual-cms\vendor\wpml\collect\src\Illuminate\Support\Traits\Macroable.php:56} ( )	...\Macroable.php:56
20	1.2085	15967264	WPML\Element\API\Languages::WPML\FP\{closure:D:\__customers\{customer}\dev-michal\app\public\wp-content\plugins\sitepress-multilingual-cms\vendor\wpml\fp\core\functions.php:135-156}( )	...\Macroable.php:56
21	1.2085	15967640	call_user_func_array:{D:\__customers\{customer}\dev-michal\app\public\wp-content\plugins\sitepress-multilingual-cms\vendor\wpml\fp\core\functions.php:152} ( )	...\functions.php:152
22	1.2086	15967656	WPML\Element\API\Languages::WPML\Element\API\{closure:D:\__customers\{customer}\dev-michal\app\public\wp-content\plugins\sitepress-multilingual-cms\vendor\wpml\core-api\core\Languages.php:205-216}( )	...\functions.php:152

( ! ) Notice: is_embed est appelée de la mauvaise manière. Les balises de requête conditionnelle ne fonctionnent pas avant le lancement de la requête. Avant cela, elles renvoient toujours le booléen false. Veuillez lire <a href="<em><u>hidden link</u></em>">Débogage dans WordPress</a> (en) pour plus d'informations. (Ce message a été ajouté à la version 3.1.0.) in D:\__customers\{customer}\dev-michal\app\public\wp-includes\functions.php on line 5313
Call Stack
#	Time	Memory	Function	Location
1	1.6144	16003232	WP_Fatal_Error_Handler->handle( )	...\class-wp-fatal-error-handler.php:0
2	1.7035	21506936	WP_Fatal_Error_Handler->display_error_template( )	...\class-wp-fatal-error-handler.php:57
3	1.7035	21507032	WP_Fatal_Error_Handler->display_default_error_template( )	...\class-wp-fatal-error-handler.php:152
4	1.7036	21509144	wp_die( )	...\class-wp-fatal-error-handler.php:233
5	1.7036	21509144	_default_wp_die_handler( )	...\functions.php:3421
6	1.7038	21511984	wp_robots( )	...\functions.php:3497
7	1.7038	21511984	apply_filters( )	...\robots-template.php:31
8	1.7038	21512384	WP_Hook->apply_filters( )	...\plugin.php:212
9	1.7038	21513888	wp_robots_noindex_embeds( )	...\class-wp-hook.php:292
10	1.7038	21513888	is_embed( )	...\robots-template.php:106
11	1.7038	21513888	_doing_it_wrong( )	...\query.php:881
12	1.7038	21515104	trigger_error ( )	...\functions.php:5313

( ! ) Notice: is_search est appelée de la mauvaise manière. Les balises de requête conditionnelle ne fonctionnent pas avant le lancement de la requête. Avant cela, elles renvoient toujours le booléen false. Veuillez lire <a href="<em><u>hidden link</u></em>">Débogage dans WordPress</a> (en) pour plus d'informations. (Ce message a été ajouté à la version 3.1.0.) in D:\__customers\{customer}\dev-michal\app\public\wp-includes\functions.php on line 5313
Call Stack
#	Time	Memory	Function	Location
1	1.6144	16003232	WP_Fatal_Error_Handler->handle( )	...\class-wp-fatal-error-handler.php:0
2	1.7035	21506936	WP_Fatal_Error_Handler->display_error_template( )	...\class-wp-fatal-error-handler.php:57
3	1.7035	21507032	WP_Fatal_Error_Handler->display_default_error_template( )	...\class-wp-fatal-error-handler.php:152
4	1.7036	21509144	wp_die( )	...\class-wp-fatal-error-handler.php:233
5	1.7036	21509144	_default_wp_die_handler( )	...\functions.php:3421
6	1.7038	21511984	wp_robots( )	...\functions.php:3497
7	1.7038	21511984	apply_filters( )	...\robots-template.php:31
8	1.7038	21512384	WP_Hook->apply_filters( )	...\plugin.php:212
9	1.7084	21513888	wp_robots_noindex_search( )	...\class-wp-hook.php:292
10	1.7084	21513888	is_search( )	...\robots-template.php:132
11	1.7084	21513888	_doing_it_wrong( )	...\query.php:699
12	1.7085	21515104	trigger_error ( )	...\functions.php:5313
March 24, 2021 at 2:26 pm #8390647

isotrope

....slight change in errors.
There's probably some WPML data that's become corrupt somewhere... and no-self-healing or error-checking.

Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in D:\__customers\{customer}\dev-michal\app\public\wp-includes\functions.php on line 599
( ! ) Exception: Serialization of 'Closure' is not allowed in D:\__customers\{customer}\dev-michal\app\public\wp-includes\functions.php on line 599
Call Stack
#	Time	Memory	Function	Location
1	0.0004	421456	{main}( )	...\edit.php:0
2	0.0004	422704	require_once( 'D:\__customers\{customer}\dev-michal\app\public\wp-admin\admin.php' )	...\edit.php:10
3	0.0004	423344	require_once( 'D:\__customers\{customer}\dev-michal\app\public\wp-load.php' )	...\admin.php:34
4	0.0004	423816	require_once( 'D:\__customers\{customer}\dev-michal\app\public\wp-config.php' )	...\wp-load.php:37
5	0.0005	434224	require_once( 'D:\__customers\{customer}\dev-michal\app\public\wp-settings.php' )	...\wp-config.php:104
6	0.1413	14353848	do_action( )	...\wp-settings.php:423
7	0.1413	14354224	WP_Hook->do_action( )	...\plugin.php:484
8	0.1413	14354224	WP_Hook->apply_filters( )	...\class-wp-hook.php:316
9	0.2703	16015360	SitePress->init( )	...\class-wp-hook.php:292
10	0.2727	16147968	SitePress->maybe_set_this_lang( )	...\sitepress.class.php:396
11	0.2733	16147992	WPML\Language\Detection\Backend->set_language_cookie( )	...\sitepress.class.php:568
12	0.2733	16148088	WPML\Language\Detection\CookieLanguage->set( )	...\wpml-request.class.php:110
13	0.2733	16148664	do_action( )	...\CookieLanguage.php:83
14	0.2733	16149040	WP_Hook->do_action( )	...\plugin.php:484
15	0.2733	16149040	WP_Hook->apply_filters( )	...\class-wp-hook.php:316
16	0.2733	16150168	WPML_User_Language->update_user_lang_on_cookie_update( )	...\class-wp-hook.php:292
17	0.2842	16163512	update_user_meta( )	...\class-wpml-user-language.php:201
18	0.2842	16163512	update_metadata( )	...\user.php:1043
19	0.2853	16222240	maybe_serialize( )	...\meta.php:226
20	0.2853	16222240	serialize ( )	...\functions.php:599

The topic ‘[Closed] Reset Cache WP Rocket All Languages Fatal Error’ is closed to new replies.