Google Map to configure location does not load when editing posts

Support General Google Map to configure location does not load when editing postsResolved

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #44658
    ArnoArno
    Participant

    Hi,

    We have several custom post types with a location field. I found that the Google Map to configure the location in the backend no longer shows. The map area is blank and the browser console shows "Uncaught ReferenceError: google is not defined at /wp-content/plugins/meta-box/js/map.js?ver=5.8.2:302:32". In the frontend, some locations are incorrect and show a default location.

    We didn't update plugins/theme for at least 3 months (we only do so twice per year after testing). So I am not sure why this problem occurs. The only thing we changed was replacing our GDPR cookie plugin by another one. If deactivate this plugin, the map still does not show, so this is not causing it.

    It's WordPress 6.4.1, Meta Box 5.8.2, and AIO 1.23.1.

    I'm afraid that any post we edit now will lose its location because of this bug.

    How do I solve this? If needed, I can e-mail you a screenshot or provide access to the staging site.

    #44663
    PeterPeter
    Moderator

    Hello,

    Please try to update Meta Box and MB AIO to the latest version and you can deactivate all plugins except Meta Box, MB AIO, switch to a WordPress theme and see if the map works.

    #44669
    ArnoArno
    Participant

    Hi Peter,

    I deactivated all plugins on our staging site, and enabled them one by one. I found that if WP Go Maps (9.0.27) is deactivated, the issue doesn't occur.

    I updated Meta Box and Meta Box AIO to the latest version, which did not help.

    Then I updated WP Go Maps and WP Go Maps Pro to the latest version, which did not help either.

    Activating the WordPress 2024 theme doesn't make a difference.

    I suppose a bug fix is needed for Meta Box, WP Go Maps or both?

    #44671
    PeterPeter
    Moderator

    That means the issue doesn't come from Meta Box itself. It could be a conflicting issue with the plugin WP Go Maps. Please contact that plugin support to get further assistance.
    Refer to our support policy https://metabox.io/support/topic/support-policy/

    #44679
    ArnoArno
    Participant

    Ok, WP Go Maps is currently looking into this.

    What happens until this is fixed, if we edit and save a post that already has a location configured? Will it keep the location it had, or remove it?

    #44683
    ArnoArno
    Participant

    I received this from WP Go Maps support: "I run a few tests regarding this and found that if we prevent our Google Maps API loading scripts from loading anywhere on the back-end, the MetaBox map in the post editor loads correctly, however, then our maps do not load in our map editor. Note that we do not load our Google Maps API in the post editor unless there is one of our maps being loaded on the page with a preview."

    Their question to you is: "Ask them to confirm how they load the Google Maps API in their plugin and what URL do they use?"

    We have been using both Meta Box and WP Go Maps for a long time and this conflict didn't pop up earlier. A change in either plugin must have caused this somehow.

    #44693
    PeterPeter
    Moderator

    Hello,

    The map is loaded in the file /wp-content/plugins/meta-box/inc/fields/map.php
    the URL that MB plugin uses is https://maps.google.com/maps/api/js

    I hope that helps.

    #44727
    ArnoArno
    Participant

    Hi again,

    WP Go Maps added a check if Google Maps is already loaded. That fixed the issue. It will be included in their next release.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.