-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map fields disappearing after save #160
Comments
I'm also getting this issue, as well as a 404 for the file /cpresources/2ed3d3ff/js/apifetch.js Did you find a fix for this one? |
I just found a fix for mine, it was another plugin causing a js error, that in turn was breaking the maps |
I am having this same issue and it's definitely a frustrating one. Is there a fix on the way? |
@jacobgraf Do you share any of the plugins @ljclark listed? The likely cause seems to be that another plugin is interfering with Maps' JS. |
Only Redactor is common between us. |
@codeartaus Would you mind sharen the plugin with us which was causing the error? |
I'm getting this error:
Saving an entry without entering a location into the maps field will break the output. So I have to re-enter the location on every save. Frustrating. Especially in combination with this issue: #165 (comment) Edit: The JS error is caused because of multiple includes in MapField.php // Map Services
// ---------------------------------------------------------------------
if (strpos($settings->mapTiles, 'google') !== false)
{
$view->registerJsFile(
'https://maps.googleapis.com/maps/api/js?libraries=places&key=' .
$settings->mapToken
);
}
elseif (strpos($settings->mapTiles, 'mapkit') !== false)
{
$view->registerJsFile(
'https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js'
);
}
// Geo Services
// ---------------------------------------------------------------------
if ($settings->geoService === GeoEnum::GoogleMaps)
{
$view->registerJsFile(
'https://maps.googleapis.com/maps/api/js?libraries=places&key=' .
$settings->geoToken
);
}
elseif ($settings->geoService === GeoEnum::AppleMapKit)
{
$view->registerJsFile(
'https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js'
);
} Removing either will still work and eleminates the error, but the bug with the disappearing data will still occur. And this seems to be why Mapbox doesn't work: it will be not included. I tried Mapbox with my API, but with no results. Output with correct saving: {
"googlePlace":{
"administrative_area_level_1":"Hamburg",
"administrative_area_level_2":"",
"administrative_area_level_3":"",
"administrative_area_level_4":"",
"administrative_area_level_5":"",
"airport":"",
"bus_station":"",
"colloquial_area":"",
"establishment":"",
"floor":"",
"intersection":"",
"locality":"Hamburg",
"natural_feature":"",
"neighborhood":"",
"park":"",
"parking":"",
"point_of_interest":"",
"political":"",
"post_box":"",
"postal_code":"20259",
"postal_code_prefix":"",
"postal_town":"",
"premise":"",
"room":"",
"route":"Osterstraße",
"street_address":"",
"street_number":"98",
"sublocality":"",
"sublocality_level_1":"Bezirk Eimsbüttel",
"sublocality_level_2":"",
"sublocality_level_3":"",
"sublocality_level_4":"",
"sublocality_level_5":"",
"subpremise":"",
"train_station":"",
"transit_station":"",
"administrative_area_level_1_short":"",
"administrative_area_level_2_short":"",
"administrative_area_level_3_short":"",
"administrative_area_level_4_short":"",
"administrative_area_level_5_short":"",
"airport_short":"",
"bus_station_short":"",
"colloquial_area_short":"",
"establishment_short":"",
"floor_short":"",
"intersection_short":"",
"locality_short":"",
"natural_feature_short":"",
"neighborhood_short":"",
"park_short":"",
"parking_short":"",
"point_of_interest_short":"",
"political_short":"",
"post_box_short":"",
"postal_code_short":"",
"postal_code_prefix_short":"",
"postal_town_short":"",
"premise_short":"",
"room_short":"",
"route_short":"",
"street_address_short":"",
"street_number_short":"",
"sublocality_short":"",
"sublocality_level_1_short":"",
"sublocality_level_2_short":"",
"sublocality_level_3_short":"",
"sublocality_level_4_short":"",
"sublocality_level_5_short":"",
"subpremise_short":"",
"train_station_short":"",
"transit_station_short":"",
"number":"98",
"address":"Osterstraße, Bezirk Eimsbüttel",
"city":"Hamburg",
"postcode":"20259",
"county":"",
"state":"Hamburg",
"country":"Deutschland"
}
} After re-saving: {
"googlePlace":{
"number":"98",
"address":"Osterstraße, Bezirk Eimsbüttel",
"city":"Hamburg",
"postcode":"20259",
"county":"",
"state":"Hamburg",
"country":"Deutschland"
}
} |
For me this bug disappears after updating Craft to 3.2 |
Works fine in 3.2 for me too! 🎉 |
Aaaaand it happens again after updating to 3.6.0 |
Upgrading to C3.2 and Maps 3.6 has made Maps complete unusable for me now. I don't even get the maps field or input on a brand new entry! Any update on this? |
Similar for me - a new install of SimpleMap 3.6 into C3.2.4.1 results in entered address not searching/saving. Empty address fields when entry opened after saving. |
This should be fixed in 3.6.1. |
Description
The Map and it's associated fields (search, address etc) are present on a new entry. When you save the entry, it's saving the location and rendering the map on the front end as expected.
However, if you try and edit that map data in the entry again, none of the inputs for the map field are visible.
There's this error in the console when you try edit the entry which I'm assuming is related to this. All other fields are fine, its just the maps field that's breaking.
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: