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.
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 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.
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.
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.