Support

Account

Home Forums ACF PRO Google Maps back-end location search functionality not working

Solving

Google Maps back-end location search functionality not working

  • Have run into an interesting issue with the ACF Google Maps feature – While the functionality on the front-end is working fine, and all the old map pointers are in place and appearing. In the backend, the Google Map search bar is no longer functioning. When searching a new location, the icon just spins indefinitely.

    Screenshot of chrome console

    Attached is the error outputs while attempting a query – i’m not sure what to make of it, do i need to register a google api key now? Is anyone else experiencing this?

  • I just tested this and it works fine. Could this be because you’re working on a dev site that you can only access locally / via hosts, so Google is unable to verify itself?

  • Hi @tanmccuin

    It’s also possible that you have a conflict with your other plugins. Could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Sixteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.

    Thanks 🙂

  • It does appear to be theme related, not plugin related. Very strange though that nothing had changed with the previous theme except the WordPress Version. No template changes or plugin changes for that matter. Would that suggest an incompatibility with the theme and the latest version of WordPress?

  • Hi @tanmccuin

    I’m not sure about it. It’s possible that your theme replaces WordPress’ scripts that are used by ACF, so it causes the error. To make sure, could you please ask the theme author regarding this issue?

    Thanks 🙂

  • That’s my assumption as well – I loaded an entirely fresh install of the base theme and tested, the errors persisted. I have a request in now with the theme developer (Themetrust – theme is Port, for anyone watching at home.)

    This is why I prefer to build themes from scratch… trying to find an obscure incompatibility in a premium theme is wretched.

    Thanks for your time – i’ll report back if a fix is forthcoming, might be interesting.

  • No help from Themetrust – they just simply said the issue is with ACF. I’m not inclined to believe that.

  • Hi @tanmccuin

    That’s really unfortunate 🙁

    The map is working with WordPress’ stock theme, right? That means their theme uses custom scripts that cause the issue. Maybe you can check the theme for something like wp_enqueue_script(), wp_dequeue_script(), wp_register_script(), or wp_deregister_script() (if they use these functions to replace the scripts).

    Thanks 🙂

  • That’s correct – I tested with stock 2016 and it worked fine, and i tested with the latest stock Port theme, and it wasn’t working. So it’s definitely on them. Thanks for the suggestions, i’ll post back here once i source the issue.

  • So i believe i’ve sourced the issue to the theme loading in “Mr Meta Box” functionality, I haven’t gone further, but i wouldn’t doubt if there was a conflict specifically with Mr Meta Box’s Geolocation function here:

    https://github.com/mrfoto/mr-meta-box/blob/master/js/geocomplete.js

    If you have a moment, have a look at that and let me know if you think that makes sense. I know that if i disable Mr Meta, the ACF maps function returns, so i’m definitely in the right place.

  • Hi @tanmccuin

    I think you found it! Maybe you can dequeue the scripts like the following?

    function my_dequeue($hook) {
        if ( 'edit.php' != $hook ) {
            return;
        }
    
        wp_dequeue_script( 'mr-geocomplete' );
        wp_dequeue_script( 'mr-google-maps' );
    }
    add_action( 'admin_enqueue_scripts', 'my_dequeue' );

    Please check the enqueued scripts here: https://github.com/mrfoto/mr-meta-box/blob/master/mr-meta-box.php#L54.

    Thanks 🙂

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Google Maps back-end location search functionality not working’ is closed to new replies.