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.
When I activate the spiderfying option on the map, I get the following javascript error:
drupal.js?v=8.4.0:13 Uncaught ReferenceError: google is not defined
at new _Class (oms.js:45)
at Object. (geolocation-spiderfying.js?p3d33t:56)
at Function.each (jquery.min.js?v=3.2.1:2)
at Object.attach (geolocation-spiderfying.js?p3d33t:32)
at Object.Drupal.attachBehaviors (drupal.js?v=8.4.0:25)
at drupal.init.js:16
at HTMLDocument.t (ready.min.js?v=1.0.8:4)
Comment | File | Size | Author |
---|---|---|---|
#4 | google-is-not-defined-2940561-4.patch | 5.92 KB | vkechagias |
|
Comments
Comment #2
vkechagias CreditAttribution: vkechagias at More than Themes commentedI can also reproduce this on 8.4.4 when trying on simplytest.me.
It seems that in the edit view preview, the library is working properly. However on the normal view page through the site theme the Spiderfying does not work and the above js error is logged.
https://www.screencast.com/t/fl041Z5XB
Maybe some sort of dependency in a library is not properly set? Or maybe it is a jQuery 3 incompatibility...
Comment #3
luigisaThe problem is when the libary "oms.min.js" is loaded. When this library is started, the "google" object does not exist yet.
By doing some testing and including a "setTimeout" in the geolocation-spiderfying.js file, I have been able to make it work.
Comment #4
vkechagias CreditAttribution: vkechagias at More than Themes commentedI believe I have fixed it! Please review.
Comment #5
luigisaThanks, that patch works very well (#4)
Comment #7
ChristianAdamski CreditAttribution: ChristianAdamski commentedMinimally altered. Thanks.