impress-org / google-maps-builder

One Google Maps plugin to rule them all. Google Maps Builder is intuitive, sleek, powerful and easy to use. Forget the rest, use the best.
https://wordpress.org/plugins/google-maps-builder/
32 stars 9 forks source link

Mashup markers don't respect Post Status #167

Closed mathetos closed 6 years ago

mathetos commented 8 years ago

@mathetos commented on Fri Mar 25 2016

Scenario:

Most likely our mashup isn't checking for the post status before populating the markers. It should and the marker should be removed from the map if the post status changes.

MALIK-0 commented 7 years ago

@matheos this is exactly the bug I've told you in my support request, so no reason for you to add another issue.

mathetos commented 7 years ago

Perfect. Thanks for the confirmation @TobiasMalikowski

MALIK-0 commented 7 years ago

@mathetos Just wanted to create a pull request with a bug fix for this, then I mentioned there is no Github repository for the pro version. So I'll post the fix here since its a one liner. Is this the prevered way of submitting a bug fix for the pro version?

File: google-maps-builder-pro/includes/admin/mashups/class-mashups-builder.php Line 527: (maybe the line is not on point, since I already have another fix (#249) in this file. WordPress Reference: https://codex.wordpress.org/Class_Reference/WP_Query#Status_Parameters

Original code:

$args = array(
    'post_type' => $post_type,
    'posts_per_page' => - 1
);

Code which fixes the issue:

$args = array(
    'post_type' => $post_type,
    'post_status' => 'publish',
    'posts_per_page' => - 1
);

Please merge this into the next release. Thanks.

nishitlangaliya commented 6 years ago

@kevinwhoffman , This issue is fixed in https://github.com/WordImpress/Maps-Builder-Pro/issues/106