Conflict WPUF Pro and ACF Google Map

This topic contains 9 reply and 2 voices, and was last updated by hartlrobert 10 years, 1 month ago
Viewing 9 Posts - 1 through 9 (of 9 total)
Author Posts
January 29, 2014 at 8:07 pm 14873
hartlrobert Hello, we are using both WPUF and ACF and up to now everything worked smoothly. Just that now a custom field Google Map doesn´t work (it shows up, but no autocomplete, search, set marker...). That is, if WPUF is active. If I deactivate WPUF, everything works as far as ACF is concerned. Seems to be a script incompability? Maybe it´s not good that the google-API is loaded twice in the backend - even if we don´t have any WPUF forms active on the edit post pages? Any help / suggestions greatly appreciated! Thank you! Peter
January 29, 2014 at 11:16 pm 14876
Tareq Hasan Tareq Hasan

May be we can quickly check in your site? In that case, please provide your site url, user login and password so we can check it. Also mark your reply as Private reply to keep it safe.

January 30, 2014 at 5:33 pm 14897
hartlrobert hartlrobert This reply has been marked as private.
January 30, 2014 at 11:17 pm 14911
Tareq Hasan Tareq Hasan

I am not sure why, but I am seeing lots of JavaScript error on the page.
js error

Somehow it’s not finding jQuery which is a must for every plugin, may be some plugin conflict?

January 31, 2014 at 6:04 pm 14957
hartlrobert hartlrobert

Hi Tareq,

thanks for your kind help so far!

From what page did you take that screenshot? The only error I get in my chrome console (apart from a notice that the Gmaps-API is loaded twice) is this:

Uncaught TypeError: Cannot read property 'Autocomplete' of undefined input.min.js?ver=4.3.4:13
acf.fields.google_map.render input.min.js?ver=4.3.4:13
acf.fields.google_map.init input.min.js?ver=4.3.4:13
(anonymous function) input.min.js?ver=4.3.4:13
x.extend.each load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:3
x.fn.x.each load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:3
(anonymous function) input.min.js?ver=4.3.4:13
x.event.dispatch load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:4
v.handle load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:4
x.event.trigger load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:4
e.event.trigger load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:9
(anonymous function) load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:4
x.extend.each load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:3
x.fn.x.each load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:3
x.fn.extend.trigger load-scripts.php?c=gzip&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,plupload-html5,pluploa…:4
(anonymous function)

I also think it might be a JS/plugin incompability. Only that, if I deactivate all plugins but ACF and WPUF the Google Maps Custom Field still doesn´t work…

Do you have any idea?

Thank you again!

January 31, 2014 at 8:46 pm 14963
Tareq Hasan Tareq Hasan

I got the errors on adding a company post type.

May be the problem occurs with the version of google maps. ACF is using version 3, where WPUF is using version 2 of google maps. May be thats creating a conflict.

January 31, 2014 at 8:55 pm 14964
hartlrobert hartlrobert

Sounds interesting. Is there a way for me to change that?
Or maybe to deactivate the WPUF Google Map code if I in fact don´t use it?

You were right – on that page I get similar messages. Strange…

January 31, 2014 at 9:03 pm 14967
Tareq Hasan Tareq Hasan

Delete this line from wpuf.php, line 167.
wp_enqueue_script( 'google-maps', $scheme . '://maps.google.com/maps/api/js?sensor=true' );

January 31, 2014 at 9:28 pm 14971
hartlrobert hartlrobert

Ok, that solved the issue with double API.

Still, I can´t make the field work. Seems, though, that others have a similar problem: http://support.advancedcustomfields.com/forums/topic/new-googlemap-field-doesnt-work

May be there is an issue with ACF. I just wonder why everything works if I deactivate WPUF.

Thank you for your help in this. If you have another idea please tell me. If I find a solution I´ll post it here…

Peter

January 31, 2014 at 10:05 pm 14976
hartlrobert hartlrobert

I looked closely now at the ACF Google Maps Field. Seems they changed they way they load the Google Maps API with their last update.

I activated the lines 58 in google-map.php wp_enqueue_script('acf-googlemaps'); and the lines 503-510 $scripts[] = array( ... in acf.php and now it works again.

Thank you for your help!
I wish you a nice weekend!

Peter

Viewing 9 Posts - 1 through 9 (of 9 total)