- 🇮🇹Italy itamair
this looks solved to me with latest Geofield Map release (11.0.x)
I have a geofield which is inside a paragraph inside a paragraph. When you click edit on the paragraph you get this JavaScript error in the console:
Uncaught TypeError: self.map_data[mapid].geocoder.caching is undefined
get_reverse_geocode_storage edit line 2 > injectedScript:237
reverse_geocode edit line 2 > injectedScript:266
map_initialize edit line 2 > injectedScript:702
attach edit line 2 > injectedScript:42
googleCallback edit line 2 > injectedScript:91
mr Underscore
googleCallback edit line 2 > injectedScript:90
The error is occurring in this code in geofield_map_widget.js:
// Get the Reverse Geocode result from Client Side Storage.
get_reverse_geocode_storage: function (mapid, latlng) {
let self = this;
let result;
let storage_type = self.map_data[mapid].geocoder.caching.clientside;
switch (storage_type) {
case 'session_storage':
result = sessionStorage.getItem('Drupal.geofield_map.reverse_geocode.' + latlng);
break;
case 'local_storage':
result = localStorage.getItem('Drupal.geofield_map.reverse_geocode.' + latlng);
break;
default:
result = null;
}
return result;
},
The error occurs on the line let storage_type = self.map_data[mapid].geocoder.caching.clientside;
The error is that self
doesn't exist, and self
has been set to this
. I'm a bit confused.
I can't debug it because I can't put a breakpoint on it since this is an injected script rather than a file. I assume the script gets loaded via the AJAX response when the edit button in the paragraph is clicked. But the paragraph in question doesn't even contain any geofield. It's the paragraph inside it which contains a geofield, and that paragraph is still collapsed. Clicking the edit button for that inner paragraph gives you a broken map.
This was working in Geofield Map 8.x-2.67 in D8, but broken in 8.x-2.75 in D9.
Closed: outdated
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
this looks solved to me with latest Geofield Map release (11.0.x)