I ran into a serious issue that causes me some headcache:
When adding or editin nodes that include a gmaps field in Internet Explorer (version 9) on a https connection any AJAX activity causes errors, such as:
- if a taxonomy term is added via hierarchical select the waiting cursor keeps spinning and all submit buttons stay disabled forever, thus making it impossible to save
- if a location is added via Google Maps Tools' field the same happens, all submit buttons disabled and waiting cursor forever

Things I found out so far:

  • When doing the exact same steps on an unsecured connection there are no problems at all
  • Hierarchical select does work via https in IE9 when the content types doesn't contain a google maps field
  • In Chrome everything works all the time

These errors are shown in the web inspector of IE9.

SEC7111: HTTPS-Sicherheit beeinträchtigt durch http://maps.google.de/maps?file=api&v=2.220&hl=de&key=ABQIAAAAj49MMCYyuCoSdnGkkhCwhxQD1RnGi57SZ_89gjG6G8NSmuK86BQx7NBPLnvrA9-5G5GaNgjhgIgcrQ 
termin
SCRIPT5009: "GMap2" ist undefiniert 
js_1acb6a0073a8bdd41c32f9f719e20e0a.js, Zeile 7191 Zeichen 1
SCRIPT5009: "GBrowserIsCompatible" ist undefiniert 
js_1acb6a0073a8bdd41c32f9f719e20e0a.js, Zeile 7163 Zeichen 3
SCRIPT438: Das Objekt unterstützt die Eigenschaft oder Methode "fieldValue" nicht 
js_1acb6a0073a8bdd41c32f9f719e20e0a.js, Zeile 6729 Zeichen 5

Is it possible to include google maps via https? Could that insecure connection be the problem?

Regards,
klickreflex

Comments

daniel wentsch’s picture

Okay, the problem seems to be with the unsecured connection to Google Maps.
I ignored IEs message that is telling me that only secure content is being shown. If I accept the button to show all content it works again.

So it really should help if it was possible to include stuff from Google via a secured connection.

digi24’s picture

You can insert most of the Google stuff via https, due to the reasons you described. Sometimes the URLs slightly differ, so do not just assume that it is the same URL prefixed with https.

Then check $_SERVER['HTTPS'] in php or via javascript to dynamically use the right protocol. You can just use the logic from googleanalytics.module:

      if(isset($_SERVER['HTTPS'])) {
        $script .= 'ga.src = "https://ssl.google-analytics.com/ga.js";';
      }
      else {
        $script .= 'ga.src = "http://www.google-analytics.com/ga.js";';
      }

and for the javascript something like:
ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";

As far as I see, the following files have to be changed:

PHP
includes/gmaps.icon-admin-labeled-marker.inc
includes/gmaps.icon-admin-marker.inc
includes/gmaps.icon-admin-iconic-marker.inc
includes/gmaps.icon-admin-iconic-marker.inc
includes/gmaps.static-map-pages.inc
includes/gmaps.icon-admin-flat.inc
includes/gmaps.geocode.inc

JS-logic
misc/gmaps-icon.js
misc/gmaps-geocoder-element.js
misc/gmaps-point-element.js