Преглед изворни кода

FD3-422 fix exception cuando no tiene latitude y longitude en user_settings

Guillermo Espinoza пре 7 година
родитељ
комит
c6a6dc8640
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      Resources/views/Leaflet/map.html.twig

+ 4 - 4
Resources/views/Leaflet/map.html.twig

@@ -30,8 +30,8 @@
     var _MAP_LATITUDE = 0;
     var _MAP_LONGITUDE = 0;
     {% if config_manager is defined %}
-    _MAP_LATITUDE = {{ config_manager.getValueConsume('location', 'location', 'latitude') }};
-    _MAP_LONGITUDE = {{ config_manager.getValueConsume('location', 'location', 'longitude') }};
+    _MAP_LATITUDE = {{ config_manager.getValue('location', 'location', 'latitude')|default(0) }};
+    _MAP_LONGITUDE = {{ config_manager.getValue('location', 'location', 'longitude')|default(0) }};
     {% else %}
     function setCoordinatesFromConfig(drawMapNow) {
         try {
@@ -65,8 +65,8 @@
 
 {% if draw is defined %}
     <script src="{{ asset('bundles/leaflet/js/leaflet-map-draw.js') }}"></script>
-{% endif %}    
+{% endif %}
 {% if extra_js is defined %}
     <script src="{{ script_google_maps }}"></script>
     <script src="{{ asset('bundles/leaflet/js/leaflet-map-widget.js') }}"></script>
-{% endif %}
+{% endif %}