ArnoldV / Our.Umbraco.GMaps

Basic Google Maps with autocomplete property editor for Umbraco 8 and beyond!
MIT License
12 stars 30 forks source link

Umbraco v8 (GMaps: 1.3.3) to Umbraco v10 (GMaps 3.0.0) legacy data value converter issues #165

Open AndyBoot opened 5 months ago

AndyBoot commented 5 months ago

I'm currently upgrading an Umbraco 8 site to Umbraco 10+, GMaps 1.3.3 to 3.0.0. I'm getting parsing issues related to this package when reading & writing data using the Map object.

On debugging SingleMapPropertyValueConverter.cs I've found the following json isn't successfully deserializing into the LegacyMap object.

{"address":{"latlng":"53.5879923, -2.5384524","full_address":"mansell house","postalcode":"bl6 6qq","city":"horwich","state":"england","country":"united kingdom"},"mapconfig":{"zoom":16,"maptype":"roadmap","mapcenter":"53.58793457153, -2.5383417500000194"}}

Both the Address and MapConfig properties are just null for the intermediate variable.

I've managed to resolve this by applying the following changes:

I hope this helps solidify this awesome package, and/or helps anybody else facing similar issues.

JohanReitsma83 commented 2 weeks ago

@robertjf @ArnoldV this issue is still there, It looks like if the properties of LegacyMap are internal it doesn't get converted using System.Text.Json, is it possible to make the properties public as suggested?