Skip to content

Commit

Permalink
Merge pull request #168 from ArnoldV/develop
Browse files Browse the repository at this point in the history
馃敄 Release 3.0.1
  • Loading branch information
robertjf committed Feb 9, 2024
2 parents 14bb5c5 + 472ca18 commit 099099c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Our.Umbraco.GMaps.Core/Our.Umbraco.GMaps.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>

<Version>3.0.0</Version>
<Version>3.0.1</Version>
<Authors>Arnold Visser</Authors>
<Company>Arnold Visser</Company>
<Description>Basic Google Maps with autocomplete property editor for Umbraco 8+. This package contains the Core DLL only.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ public override object ConvertIntermediateToObject(IPublishedElement owner, IPub
Map model = null;
if (inter != null)
{
// Handle pre v2.0.0 data.
inter = inter.ToString().ToLower().Replace("google.maps.maptypeid.", string.Empty);
bool legacyData = inter.ToString().Contains("latlng");
var jsonString = inter.ToString();

// Handle pre v2.0.0 data (Removes the prefix 'google.maps.maptypeid.')
jsonString = jsonString.Replace("google.maps.maptypeid.", string.Empty, StringComparison.InvariantCultureIgnoreCase);

bool legacyData = jsonString.Contains("latlng", StringComparison.CurrentCultureIgnoreCase);
if (legacyData)
{
var intermediate = JsonSerializer.Deserialize<LegacyMap>(inter.ToString());
var intermediate = JsonSerializer.Deserialize<LegacyMap>(jsonString);
model = new Map
{
Address = intermediate.Address,
Expand All @@ -51,7 +54,7 @@ public override object ConvertIntermediateToObject(IPublishedElement owner, IPub
}
else
{
model = JsonSerializer.Deserialize<Map>(inter.ToString());
model = JsonSerializer.Deserialize<Map>(jsonString);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Our.Umbraco.GMaps/Our.Umbraco.GMaps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<Version>3.0.0</Version>
<Version>3.0.1</Version>
<Authors>Arnold Visser</Authors>
<Company>Arnold Visser</Company>
<Description>Basic Google Maps with autocomplete property editor for Umbraco 8+</Description>
Expand Down

0 comments on commit 099099c

Please sign in to comment.