Skip to content Skip to sidebar

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

Problem:
When trying to 'Add new page' in Elementor with only the WPML Multilingual CMS plugin active, the page does not load and displays a grey spinning page. A JavaScript error appears in the console indicating an 'Uncaught TypeError: Cannot convert undefined or null to object'.
Solution:
We recommend adding the following code to your theme's functions.php file to address this issue:

//compsupp_7780 workaround
add_action( 'elementor/document/after_save', 'compsupp_7780_after_document_save' );
function compsupp_7780_after_document_save( $document ) {
    $wpml_page_id = $document->get_post()->ID;
    wp_update_post(array('ID' => $wpml_page_id));=
    return $document;
}

If this solution does not resolve your issue, or if it seems outdated or irrelevant 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. Additionally, you can open a new support ticket for further assistance 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 1 voice.

Last updated by Shekhar Bhandari 6 months, 2 weeks ago.

Assisted by: Shekhar Bhandari.

Author Posts
January 13, 2025 at 10:49 am #16587808

jamesO-17

Hey Shekhar,
This is working now after adding this code snippet. We are using the Elementor theme so I've added it in that functions.php file but I'm worried if the theme ever gets updated we're just going to lose this snippet every time its updated?

January 15, 2025 at 4:14 am #16595455

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello,

Please note that this is a workaround, meaning you will need to reapply the code each time the theme is updated. To avoid this, you can add the code separately using a child theme or a code snippet plugin.

That said, I’d like to inform you that this issue has also been escalated to our development team for further investigation.

Thank you!