Fitoussi / geo-my-wp

Advanced mapping and geolocation plugin for Wordpress
https://geomywp.com
36 stars 22 forks source link

3.6.2 bug when Pods plugin is not installed #72

Closed convergine closed 3 years ago

convergine commented 3 years ago

Hello. We don't have Pods plugin installed. Once we go to any post, which has GeoMyWP locator, we see the following in the console: Uncaught SyntaxError: Unexpected token '==' which breaks the rest of the js. Page source reads the following:

if (  == true ) {
    GMW.add_filter( 'gmw_location_form_prevent_form_submission', function() {
        return false;
    });
}

File /wp-content/plugins/geo-my-wp/plugins/posts-locator/includes/admin/class-gmw-posts-locator-screens.php:371 has the following:

$pods_enabled = class_exists( 'PodsAdmin' ) ? true : false;
if ( <?php echo $pods_enabled; ?> == true ) {
    GMW.add_filter( 'gmw_location_form_prevent_form_submission', function() {
        return false;
    });
}

Could you please fix this? Implemented a quick temp fix with: $pods_enabled = class_exists( 'PodsAdmin' ) ? true : "false"; But I guess the whole IF statement should be a part of PHP, not JS.

Thank you.

Fitoussi commented 3 years ago

Hello @convergine,

I just released version 3.6.3 of the plugin which should take care of this issue.

Please update the plugin on your site and see if it works.