• Resolved spatton99

    (@spatton99)


    We’re using the HubSpot Form elementor widget to embed the contact form from HubSpot on the WordPress site. This morning, we started getting the warning:

    Warning: Undefined array key "embedVersion" in .../wp-content/plugins/leadin/public/admin/widgets/class-elementorform.php on line 140.

    That’s in the render function, where the code is attempting to populate a value for embedVersion that doesn’t exist in the $settings['content'] array. The way i’ve “fixed” it for the time being is to comment out setting that variable and outputting it in the shortcode, but that will be overwritten with the next plugin update. This could be avoided by initializing the variable rather than depending on a value from the $settings['content'] array.

    protected function render() {
    $settings = $this->get_settings_for_display();
    $content = $settings['content'];
    if ( Plugin::$instance->editor->is_edit_mode() ) {

    ?>
    <div class="hubspot-form-edit-mode" data-attributes="<?php echo esc_attr( wp_json_encode( $content ) ); ?>">
    &nbsp;
    </div>
    <?php
    if ( empty( $content ) ) {
    ?>
    <div class="hubspot-widget-empty">

    </div>
    <?php
    }
    }

    if ( ! empty( $content ) ) {
    $portal_id = $content['portalId'];
    $form_id = $content['formId'];
    //$version = $content['embedVersion'];
    echo do_shortcode( '[hubspot portal="' . $portal_id . '" id="' . $form_id . '" type="form" version="' /*. $version*/ . '"]' );
    }
    }
Viewing 1 replies (of 1 total)
  • Plugin Support harthur1990

    (@harthur1990)

    Hi Thanks for reporting the issue, a fix is available at the 11.3.6 version where we validate the array key before assign to a variable

    Best regards

Viewing 1 replies (of 1 total)

The topic ‘Undefined array key “embedVersion”’ is closed to new replies.