Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have tried using the latest stable release and couldn't get things working. There were js errors in the console and the maps are not loaded.
"Uncaught SyntaxError: Unexpected token =" google_map_field_setter.js:107
"Uncaught ReferenceError: googleMapFieldPreviews is not defined" google_map_field_previews.js?nq1a60:16
I switched back to 7.x-2.13 and everything works fine.
PS: tested on vanilla drupal with jquery update - jquery 1.10
Comments
Comment #1
drupaledmonk CreditAttribution: drupaledmonk commentedComment #2
martinpesout CreditAttribution: martinpesout commentedI have exactly the same problem. Any idea how to fix it?
Comment #3
drupaledmonk CreditAttribution: drupaledmonk commentedFor now roll back to 7.x-2.13 it works fine. I am taking the liberty to mark this as critical, since new users downloading this awesome module will not be able to get it work.
Comment #4
scot.hubbard CreditAttribution: scot.hubbard commentedI'm going to check this out on a fresh Drupal install, but on my dev version (which is fairly clean) I am not seeing these issues.
There were quite a few Javascript changes made in the 7.x-2.15 release, might be worth making sure your browser's cache is clean.
I'll let you know what I find.
Thanks.
Comment #5
martinpesout CreditAttribution: martinpesout commentedCheck also the case when you install previous stable version on your Drupal and after that you will do update to the latest stable version of this plugin.
Comment #6
scot.hubbard CreditAttribution: scot.hubbard commentedHi,
OK - I have tested on a clean install of Drupal (using google map field version 7.x-2.15) and I have also tested on a clean install of Drupal after upgrading from google map field 7.x-2.13 to 7.x-2.15.
The only issue I found is that you must set your admin theme to use jQuery 1.7 or above. If you are using "Seven" as your admin theme, the default jquery_update install leave it using jquery version bundled with the core which is 1.4.
After changing the admin theme to use jquery 1.7 I did not receive any errors. Because of this I have reduced the priority to normal.
It goes without saying that the site itself must use jquery 1.7 or above.
Please let me know how you get on.
Thanks,
Scot.
Comment #7
martinpesout CreditAttribution: martinpesout commentedI confirm that after switching to jQuery 1.7 you won't get any error anymore. But after switching to jQuery 1.7 I had to update also jquery.form.js to latest version because I started to get another error during AJAX request on some forms in admin section.
Is it true that default jQuery for Admin section in Drupal 7 is jQuery 1.4.x? I'm worried whether low-experienced users can make this update without any additional instructions.
Comment #8
martinpesout CreditAttribution: martinpesout commentedSorry. I've mistaken. I still see this problem after switching to jQuery 1.7. No progress. Still the same bug as before. Can you tell me what kind of workaround are you using in admin section to update default jquery and other libraries (jquery.form.js and maybe other) to newer version? Thanks
Comment #9
scot.hubbard CreditAttribution: scot.hubbard commentedHi Martin,
I am not using any work-arounds.
The jQuery Update module gives you the option to set the version of jQuery for the site theme and the admin theme. If you leave with default settings then the admin theme is set to the Drupal core version of jQuery which is 1.4.
I have tested this on a clean install of Drupal with just the jquery_update and google_map_field modules installed and no other settings touched, and I cannot replicate what you are seeing.
Cheers,
Scot.
Comment #10
martinpesout CreditAttribution: martinpesout commentedI've installed jquery_update but I still get this error. But I've found solution of this problem. In google_map_field_setter.js on the line 107 update:
to this:
After reload the problem is gone. But it's still important to have enabled jquery_update
Comment #11
scot.hubbard CreditAttribution: scot.hubbard commentedHi Martin,
I am glad that fixes the error for you, although it does look a bit of an odd method!
Also, while taking a break from writing this reply, I have realised that the issue you are seeing is browser specific! Are you using Chrome?
Change the following from...
...to...
and it should fix it. I'll roll this into another release.
Thanks,
Scot.
Comment #12
martinpesout CreditAttribution: martinpesout commentedYeah. I'm using Chrome. And agree. Your suggestion of fix is better :)
Comment #13
scot.hubbard CreditAttribution: scot.hubbard commentedFixed in release 7.x-2.16.