Skip Navigation

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

Problem:
The client was trying to translate a page using WPML with Elementor and encountered several warnings related to undefined array keys and invalid arguments for foreach loops in the files class-wpml-elementor-translate-ids.php and DynamicElements.php.
Solution:
We recommend updating to the latest version of the Consulting theme, which includes a fix for these issues. If you're experiencing this problem, please ensure you have the latest theme version installed.

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we 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. If further assistance is needed, please do not hesitate to open a new support ticket at WPML support forum.

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

Last updated by Itamar 6 days, 23 hours ago.

Assisted by: Itamar.

Author Posts
March 25, 2025 at 12:57 pm

malteM-7

Background of the issue:
I was trying to translate my second page using WPML and encountered several warnings related to Elementor. The warnings occurred in the file located at /var/www/html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translate-ids.php. I was attempting to translate the page when the issue occurred. Here are some warnings that can be seen on my page:

Warning: Undefined array key "elements" in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translate-ids.php on line 120

Warning: foreach() argument must be of type array|object, null given in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translate-ids.php on line 112

Warning: foreach() argument must be of type array|object, null given in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translate-ids.php on line 133

Warning: foreach() argument must be of type array|object, null given in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DynamicElements.php on line 71

Warning: foreach() argument must be of type array|object, null given in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DynamicElements.php on line 71type array|object, null given in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DynamicElements.php on line 71

Warning: foreach() argument must be of type array|object, null given in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elem

Warning: foreach() argument must be of entor/Hooks/DynamicElements.php on line 71

Symptoms:
I received multiple warnings such as 'Warning: Undefined array key "elements"' and 'Warning: foreach() argument must be of type array|object, null given' in various lines of the class-wpml-elementor-translate-ids.php file and DynamicElements.php file.

Questions:

March 25, 2025 at 1:54 pm
March 25, 2025 at 2:35 pm #16858501

Itamar
WPML Supporter since 02/2016

Languages: English (English )

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

Hi,

The problem is with the Consulting Elementor Widgets plugin.
When it is deactivated, the warnings do not show.
Can you please confirm this?
Also, can you please tell me what this plugin's purpose is?

Thanks,
Itamar.

March 25, 2025 at 3:51 pm #16858815

malteM-7

Thanks for your investigation Itamar.
The plugin is needed. This is a core plugin of the Consulting Theme. It enables CTA Buttons and other widget that are part of the wordpress theme / template.

KR

Malte

March 26, 2025 at 10:13 am #16861505

Itamar
WPML Supporter since 02/2016

Languages: English (English )

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

Hi, Malte.

I've escalated this issue to our compatibility team. I'll keep you updated when I have news.

I appreciate your patience.
Itamar.

April 2, 2025 at 5:59 pm #16888454

Itamar
WPML Supporter since 02/2016

Languages: English (English )

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

Hi,

Our compatibility team further escalated this issue to our developers.
I've read our internal documentation about this case, and we will need to contact the Consulting Elementor Widgets plugin to correct things on their side. In any case, I'll keep you updated on any news here.

I appreciate your patience.
Itamar.

April 10, 2025 at 7:24 pm #16920358

Itamar
WPML Supporter since 02/2016

Languages: English (English )

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

Hi,

The developers of the Consulting Elementor Widgets plugin wrote to us to say they would look into this problem. Meanwhile, we published an errata page about it.

https://wpml.org/errata/consulting-theme-the-sidebar-widget-may-trigger-php-warnings/

Regards,
Itamar.

July 6, 2025 at 10:22 am #17204780

Itamar
WPML Supporter since 02/2016

Languages: English (English )

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

Hןת

I want to update you that the latest version of the Consulting theme includes a fix for this issue.

I'm closing this ticket. Please don't hesitate to contact us again with any WPML-related issues or questions.

Take care,
Itamar.