Inline Editor not loading exiting value for editing when elements load in modal

18 Views Asked by At

I have posted this on elementor support, but posted here for community, if anyone can help? https://github.com/elementor/elementor/issues/25359

I have two custom widget - "Quote" and "Member Popup". Member profile is showing in popup when user click a link "Bio" inside Quote widget. Inside Quote, user select a Member and when click on "Bio" link, that's member's profile shows in modal.

Member Popup widget, I am rending programmatically inside render() function of Quote widget. Member popup controls like First name, Last name, email, Designation etc. are inline enabled. Everything works file as designed. Only issue is that, when I add the widget Quote and select the member and opened the dialog for member and clicked on First name or Last name or any control for editing, it shows placeholder "Type Here..." and blank! Not showing the existing values. Note that, I did not saved the page yet. If I save the page and reload the page and then again go for edit, now it shows the existing value for editing.

What I see that, there is a JavaScript variable called "ElementorConfig" which actually always loading blank information for the fields when Editor first preview the widget.

Please note that, I am working on local environment. We have both Elementor and Elementor Pro plugins enabled. But pro version is not activated locally.

Here is the video for the issue, https://www.awesomescreenshot.com/video/25502143?key=84941b5594230f02e5fa0f530fb31043

I have rendered the widget and added to render() function like follows:

$popup_widget = \Elementor\Plugin::instance()->elements_manager->create_element_instance(
    [
        'elType' => 'widget',
        'widgetType' => 'smma-member-popup',
        'id' => 'pop'.rand(8,8),
        'settings' => [
            'title' => !empty($author->post_title) ? $author->post_title : '',
            'content' => !empty($author_content) ? $author_content : '',
            'first_name' => !empty($first_name) ? $first_name : '',
            'last_name' => !empty($last_name) ? $last_name : '',
            'sub_title' => !empty($sub_title) ? $sub_title : '',
            'email' => !empty($email) ? $email : '',
            'contact_number' => !empty($phone) ? $phone : '',
            'education' => !empty($education) ? $education : '',
            'affiliation' => !empty($affiliation) ? $affiliation : '',
            'featured_image' => array(
                'id' => !empty($author) ? get_post_thumbnail_id( $author->ID ) : '',
                'url' => !empty($author_image['url']) ? $author_image['url'] : '',
            ),
        ],
    ],
    [
        'quote_post_id' => $quote_id,
        'member_post_id' => $author_id,
    ]
);
$popup_widget->print_element();
0

There are 0 best solutions below