calvez
7/14/2017 - 8:50 AM

ovodafejlesztés gists

ovodafejlesztés gists

#https://www.drupal.org/files/issues/geolocation-Fixes-MissingKeyMapError-2873363-2.patch

diff --git a/modules/geolocation_googlemaps_d8/geolocation_googlemaps_d8.module b/modules/geolocation_googlemaps_d8/geolocation_googlemaps_d8.module
index addf879..41abbec 100644
--- a/modules/geolocation_googlemaps_d8/geolocation_googlemaps_d8.module
+++ b/modules/geolocation_googlemaps_d8/geolocation_googlemaps_d8.module
@@ -70,8 +70,13 @@ function geolocation_googlemaps_d8_field_widget_form(&$form, &$form_state, $fiel
       $element['#attached']['css'][] = drupal_get_path('module', 'geolocation_googlemaps_d8') . '/geolocation_googlemaps_d8.css';

       // Attach js
+      $data = array('libraries' => 'places');
+      $api_key = variable_get('geolocation_googlemaps_api_key', '');
+      if (!empty($api_key)) {
+        $data['key'] = $api_key;
+      }
       $element['#attached']['js'][] = array(
-        'data' => '//maps.googleapis.com/maps/api/js?libraries=places',
+        'data' => '//maps.googleapis.com/maps/api/js?' . drupal_http_build_query($data),
         'type' => 'external',
       );
       $element['#attached']['js'][] = array(
sudo /bin/bash ./fix-permissions.sh --drupal_path=/var/www/ovodafejlesztes.clvsrv.xyz/htdocs --drupal_user=calvez --httpd_group=www-data