Home Forums ACF PRO MAP field breaks JS


MAP field breaks JS

  • I am lost…

    Since the latest update, adding a MAP field to a frontend form breaks all JS, including conditional field display, image upload, etc.

    The JS error I get is
    TypeError: undefined is not an object (evaluating 'new google.maps.places.Autocomplete')
    in acf-input.min.js

    I have absolutely no idea what else I changed, there are no new plugins, etc.
    This is only if the form includes a MAP field, if not, all other fields are working.

    Can anyone confirm this?
    Unfortunately, this is not on a public site, so I can’t submit an URL etc.

  • Edit: This happens also on the Backend (Admin)… On custom post types with ACF map field, JS is broken.

  • Ok I was wrong – it IS a plugin that stops the MAP field and other JS from working.
    In fact, ANY other Map plugin conflicts with ACF.

    Either the map created from the plugin won’t render, or the plugin breaks ACF’s JS.

    The Plugin (WP GPX Maps) loads a script in its plugin file correctly with wp_enqueue_script( 'googlemaps', '//', null, null);
    which causes the conflict.

    Any attempt to load this JS only on certain pages etc fails (function.php with add_action etc).

    I am not sure wether this is a problem with the plugin or with ACF, any help is appreciated.

  • Solved it by modifying the plugin to enqueue only on that certain page.

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

The topic ‘MAP field breaks JS’ is closed to new replies.