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

Last updated by Bruno Kos 6 days, 23 hours ago.

Assisted by: Bruno Kos.

Author Posts
January 31, 2025 at 7:23 pm #16657067

juan-fM-4

Background of the issue:
I am trying to set up translations for all Elementor Pages and Templates that are used on the pages I'm testing. I am currently redirecting /es/ to hidden link for all users not on my IP as WPML is crashing the Spanish language site.

Symptoms:
Loading the pages or trying to edit in Elementor throws a critical error. The error log includes a PHP Warning: Undefined array key 'widgetType' and a PHP Fatal error: Uncaught Error: Call to a member function get_class_name() on array in /home/123456789.cloudwaysapps.com/abcxyz/public_html/wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php on line 196.

Questions:
Why is WPML crashing the Spanish language site?
How can I resolve the critical error when loading or editing pages in Elementor?

February 1, 2025 at 5:09 pm #16658673

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

Hi,

This is probably not related to the RC1 because we had this issue in several previous cases. That being said, is only one page affected (e.g. home) or all the pages?

If so, if you are using the templates (footer, header) etc, can you do this for the templates and the page where the the issue occurs:

1. Open the default language page/template in Edit mode.
2. Edit it with Elementor page builder.
3. Make a small change, for example, add a heading element.
4. Press the Save/Update button.
5. Now, please remove that heading elementor that did in step #3.
6. Update the page again.
7. Open the translation and resave it.

Does the issue occur then?

It is based on
https://wpml.org/forums/topic/translation-stuck-11/#post-15545145
https://wpml.org/forums/topic/elementor-post-are-experiencing-critical-error/#post-16514846

February 7, 2025 at 6:57 pm #16681116

juan-fM-4

It is on all pages, and unfortunately this is not resolving the issue. All assigned Spanish translations are throwing that error, editing the Header/Footer and global widget that are on the page as described and resaving does not fix the issue. Here is the error:

[07-Feb-2025 18:54:43 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_class_name() on array in /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php:196
Stack trace:
#0 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php(163): ElementorPro\Modules\GlobalWidget\Widgets\Global_Widget->init_original_element_instance()
#1 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php(158): ElementorPro\Modules\GlobalWidget\Widgets\Global_Widget->get_original_element_instance()
#2 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(332): ElementorPro\Modules\GlobalWidget\Widgets\Global_Widget->get_controls()
#3 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(296): Elementor\Core\Files\CSS\Post->render_element_global_styles()
#4 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(226): Elementor\Core\Files\CSS\Post->render_styles()
#5 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(313): Elementor\Core\Files\CSS\Post->add_controls_stack_style_rules()
#6 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(297): Elementor\Core\Files\CSS\Post->render_element_styles()
#7 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(226): Elementor\Core\Files\CSS\Post->render_styles()
#8 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(313): Elementor\Core\Files\CSS\Post->add_controls_stack_style_rules()
#9 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(297): Elementor\Core\Files\CSS\Post->render_element_styles()
#10 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(178): Elementor\Core\Files\CSS\Post->render_styles()
#11 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/base.php(687): Elementor\Core\Files\CSS\Post->render_css()
#12 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/base.php(180): Elementor\Core\Files\CSS\Base->parse_content()
#13 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/base.php(133): Elementor\Core\Files\Base->update_file()
#14 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/base.php(229): Elementor\Core\Files\CSS\Base->update()
#15 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/core/files/css/post.php(201): Elementor\Core\Files\CSS\Base->enqueue()
#16 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/includes/frontend.php(1179): Elementor\Core\Files\CSS\Post->enqueue()
#17 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor/includes/frontend.php(1098): Elementor\Frontend->get_builder_content()
#18 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/class-wp-hook.php(324): Elementor\Frontend->apply_builder_in_content()
#19 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#20 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1933): apply_filters()
#21 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(635): WP_REST_Posts_Controller->prepare_item_for_response()
#22 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/rest-api/class-wp-rest-server.php(1292): WP_REST_Posts_Controller->get_item()
#23 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request()
#24 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()
#25 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/rest-api.php(449): WP_REST_Server->serve_request()
#26 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/class-wp-hook.php(324): rest_api_loaded()
#27 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#28 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/plugin.php(565): WP_Hook->do_action()
#29 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/class-wp.php(418): do_action_ref_array()
#30 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/class-wp.php(813): WP->parse_request()
#31 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-includes/functions.php(1336): WP->main()
#32 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-blog-header.php(16): wp()
#33 /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/index.php(17): require('...')
#34 {main}
thrown in /home/1234567.cloudwaysapps.com/hqwfvqkvnu/public_html/wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php on line 196

February 7, 2025 at 7:06 pm #16681124

juan-fM-4

Now, when I go into a single page, it wants me to retranslate the entire page. All the pages have already been translated. They've been linked to their corresponding English translations. Resaving the linked translation does not work.

This is incredibly frustrating after having all the pages translated and linking the corresponding Spanish to English translations. WPML seems to be requiring us to start completely from scratch. Am I missing something?

Greatly appreciate any assistance you can provide to resolve this.

February 10, 2025 at 6:51 am #16685032

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

Would you be willing to provide me with WordPress and FTP credentials so I could investigate the issue directly?

So I would see this issue if I try to open the translation in the frontend? Or if you try to open translation in Elementor in the backend?

To confirm, did you translate pages using Advanced Translation Editor (https://wpml.org/documentation/translating-your-contents/advanced-translation-editor/#side-by-side-contextual-translation-editor) or directly in Elementor?

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

I marked your next reply as private so that you can safely add credentials.

February 13, 2025 at 7:16 am #16700148

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

Before I check this further, can you update to our new versions? Does it fix the issue?
hidden link

We released it only 3 days ago.

February 13, 2025 at 3:19 pm #16703393

juan-fM-4

Unfortunately it is still throwing the error.

February 14, 2025 at 11:58 am #16706147

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

I see, so the error occurs as soon as I want to open any translation in Elementor directly. And even if I visit the translated page in the frontend?

To troubleshoot this problem, I'll install the Duplicator plugin and generate packages for further debugging purposes. I'll ensure to exclude all media files to maintain a minimal package size.

You can find more information about the process here: https://wpml.org/faq/provide-supporters-copy-site/

Please confirm if this approach is acceptable to you. This will most likely required debugging because WPML troubleshooting functions did not help.

February 15, 2025 at 3:53 am #16708374

juan-fM-4

Yes, that's correct, frontend throws the error as well.

Sounds good, thanks so much.

February 17, 2025 at 10:27 am #16713145

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

I am checking this with our 2nd tier and will keep you posted.

February 19, 2025 at 7:53 am #16722440

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

What if you try this:

DELETE FROM wp_posts WHERE ID = 2994;

Do Spanish pages work now (both frontend and backend)?

February 24, 2025 at 6:25 pm #16742674

juan-fM-4

I've pushed the site to a staging site before deleting that post ID. I'm not sure how to provide the new URL to you here privately in this reply. If you can provide that form again, that would be great. The credentials stay the same as the files/db are identical.

Backend: when attempting to edit in Elementor loads the page, however the formatting looks off and there are some background images of elements that aren't showing. A form widget (I assume what we deleted) is gone.

Frontend: loads until reaching an error. It appears a form widget doesn't load so the page fails at that point. Here is the PHP error:

[24-Feb-2025 17:55:15 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_class_name() on null in /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php:196
Stack trace:
#0 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php(163): ElementorPro\Modules\GlobalWidget\Widgets\Global_Widget->init_original_element_instance()
#1 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php(158): ElementorPro\Modules\GlobalWidget\Widgets\Global_Widget->get_original_element_instance()
#2 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php(2516): ElementorPro\Modules\GlobalWidget\Widgets\Global_Widget->get_controls()
#3 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php(1158): Elementor\Controls_Stack->sanitize_settings()
#4 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php(2259): Elementor\Controls_Stack->get_data()
#5 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/core/base/base-object.php(142): Elementor\Controls_Stack->get_init_settings()
#6 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/core/base/base-object.php(40): Elementor\Core\Base\Base_Object->ensure_settings()
#7 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php(1172): Elementor\Core\Base\Base_Object->get_settings()
#8 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php(1263): Elementor\Controls_Stack->get_parsed_dynamic_settings()
#9 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor-pro/modules/display-conditions/module.php(174): Elementor\Controls_Stack->get_settings_for_display()
#10 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/class-wp-hook.php(324): ElementorPro\Modules\DisplayConditions\Module->before_element_render()
#11 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#12 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#13 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/element-base.php(474): do_action()
#14 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/element-base.php(1442): Elementor\Element_Base->print_element()
#15 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/element-base.php(483): Elementor\Element_Base->print_content()
#16 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/element-base.php(1442): Elementor\Element_Base->print_element()
#17 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/base/element-base.php(483): Elementor\Element_Base->print_content()
#18 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/core/base/document.php(1890): Elementor\Element_Base->print_element()
#19 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/core/base/document.php(1806): Elementor\Core\Base\Document->do_print_elements()
#20 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/core/base/document.php(1204): Elementor\Core\Base\Document->print_elements()
#21 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/frontend.php(1203): Elementor\Core\Base\Document->print_elements_with_wrapper()
#22 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor/includes/frontend.php(1098): Elementor\Frontend->get_builder_content()
#23 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/class-wp-hook.php(324): Elementor\Frontend->apply_builder_in_content()
#24 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#25 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/post-template.php(256): apply_filters()
#26 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/themes/hello-elementor/template-parts/single.php(24): the_content()
#27 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/template.php(812): require('...')
#28 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/template.php(745): load_template()
#29 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/general-template.php(206): locate_template()
#30 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/themes/hello-elementor/index.php(20): get_template_part()
#31 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-includes/template-loader.php(106): include('...')
#32 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-blog-header.php(19): require_once('...')
#33 /home/1234567.cloudwaysapps.com/abcdefghij/public_html/index.php(17): require('...')
#34 {main}
thrown in /home/1234567.cloudwaysapps.com/abcdefghij/public_html/wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php on line 196

February 25, 2025 at 8:06 am #16744202

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

I set your next reply as private.

Please install https://wordpress.org/plugins/pexlechris-adminer/ to that site and provide me FTP and WordPress credentials.

February 26, 2025 at 10:05 am #16750082

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

I am checking with the help of our 2nd tier and will keep you posted.

February 27, 2025 at 7:28 am #16754124

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

We’ve prepared a workaround to address the issue with the global widget. Please follow these steps:

1. Navigate to:

.../wp-content/plugins/elementor-pro/modules/global-widget/widgets/global-widget.php

2. Add the following code below:

   if ($data) {  
       if (  
           $data['widgetType'] === 'global' &&  
           (get_post_type($data['templateID']) !== 'elementor_library' || $data['templateID'] === '' || $data['templateID'] == 2994)  
       ) {  
           $data['templateID'] = 2970;  
       }  
   }  
   

Placement: Insert it right below this function declaration:

   public function __construct( $data = [], $args = null ) {
   

This adjustment ensures that the

templateID

is set to

2970

, which exists on your site.

3. After implementing this fix:
- Edit the affected page(s) and properly configure the global widget.
- Once all pages are updated, this code can be safely removed.

While this workaround should resolve the issue temporarily, we have a few concerns:

- Post ID 2994 appears to be a revision, not an

elementor_library

entry.
We’re unsure how this happened—could you confirm if you recently imported a template, migrated the database, or made any other changes that might have led to corrupted IDs?

- This fix is specific to one

templateID

.
It only resolves the issue for template

2970

. If multiple pages are affected, it may be better to recreate or duplicate the global widget and remove the original to prevent further issues.

- Potential Elementor bug:
If this issue persists, Elementor may need to implement an additional check to validate the

post_type

before processing global widgets.

Please let us know how you'd like to proceed or if you have any additional context that might help identify the root cause.