Skip to content
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

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

Open
AndyBoot opened this issue Jan 28, 2024 · 1 comment

Comments

@AndyBoot
Copy link

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:

  • LegacyAddress.cs - changing LatLng from internal to public. Adding [JsonPropertyName("latlng")].
  • LegacyMapConfig.cs - changing MapCenter from internal to public. Adding [JsonPropertyName("MapCenter")]. In addition, I've also removed the Zoom property as I found it an unnecessary addition, and zoom parses perfectly fine without it.
  • SingleMapPropertyValueConverter.cs - Removed Line 50 (model.MapConfig.Zoom = ...)

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

robertjf added a commit to robertjf/Our.Umbraco.GMaps that referenced this issue Feb 9, 2024
robertjf added a commit that referenced this issue Feb 9, 2024
🔖 🐛 Fix for #165 legacy data value converter issues
@robertjf robertjf mentioned this issue Feb 9, 2024
@JohanReitsma83
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants