Skip to content
Merged

4.1.6 #172

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-build-prelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
10.x

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.2.0
uses: gittools/actions/gitversion/setup@v4.5.0
with:
versionSpec: '6.x'

Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:

- name: Determine Version with GitVersion (MSBuild in Proj will do this)
id: gitversion
uses: gittools/actions/gitversion/execute@v4.2.0
uses: gittools/actions/gitversion/execute@v4.5.0
with:
useConfigFile: true
configFilePath: ./GitVersion.yml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-build.stablerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
10.x

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.2.0
uses: gittools/actions/gitversion/setup@v4.5.0
with:
versionSpec: '6.x'

Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:

- name: Determine Version with GitVersion (MSBuild in Proj will do this)
id: gitversion
uses: gittools/actions/gitversion/execute@v4.2.0
uses: gittools/actions/gitversion/execute@v4.5.0
with:
useConfigFile: true
configFilePath: ./GitVersion.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,24 +150,16 @@ private void ProcessContentType(IContentType contentType)
{
if (property.PropertyType.PropertyEditorAlias == UmbNavConstants.LegacyEditorAlias)
{
var legacyValue = property.GetValue()?.ToString();
if (!string.IsNullOrWhiteSpace(legacyValue))
if (property.PropertyType.VariesByCulture())
{
try
foreach (var culture in content.AvailableCultures)
{
// Example transformation logic; adjust as needed
var hasTransformed = TryTransformLegacyValue(_logger, legacyValue, out var newValue);
if (hasTransformed)
{
property.SetValue(newValue);
saveContent = true;
}
saveContent |= GetValueAndTryTransform(saveContent, property, culture);
}
catch (Exception ex)
{
_logger.LogError(ex, "Something went wrong migrating legacy content.{legacyValue}", legacyValue);
}

}
else
{
saveContent = GetValueAndTryTransform(saveContent, property, null);
}
}
}
Expand Down Expand Up @@ -195,6 +187,31 @@ private void ProcessContentType(IContentType contentType)

}

private bool GetValueAndTryTransform(bool saveContent, IProperty property, string? culture)
{
var legacyValue = property.GetValue(culture)?.ToString();
if (!string.IsNullOrWhiteSpace(legacyValue))
{
try
{
// Example transformation logic; adjust as needed
var hasTransformed = TryTransformLegacyValue(_logger, legacyValue, out var newValue);
if (hasTransformed)
{
property.SetValue(newValue, culture);
saveContent = true;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Something went wrong migrating legacy content.{legacyValue}", legacyValue);
}

}

return saveContent;
}

// Add this static readonly field to cache the JsonSerializerOptions instance
private static readonly JsonSerializerOptions CachedJsonSerializerOptions = new JsonSerializerOptions
{
Expand Down
Loading
Loading