Skip to content

Commit 32d5403

Browse files
Clone JsonNode when copying it to a different parent
1 parent efec16f commit 32d5403

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Umbraco.Deploy.Contrib/Migrators/Legacy/Content/DocumentArtifactJsonMigrator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public override JsonNode Migrate(JsonNode artifactJson)
2626
{
2727
schedule.Add(new JsonObject()
2828
{
29-
["Date"] = releaseDate,
29+
["Date"] = releaseDate.DeepClone(),
3030
["Culture"] = string.Empty,
3131
["Action"] = nameof(ContentScheduleAction.Release)
3232
});
@@ -36,7 +36,7 @@ public override JsonNode Migrate(JsonNode artifactJson)
3636
{
3737
schedule.Add(new JsonObject()
3838
{
39-
["Date"] = expireDate,
39+
["Date"] = expireDate.DeepClone(),
4040
["Culture"] = string.Empty,
4141
["Action"] = nameof(ContentScheduleAction.Expire)
4242
});

src/Umbraco.Deploy.Contrib/Migrators/Legacy/ContentType/ContentTypeArtifactJsonMigrator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public override JsonNode Migrate(JsonNode artifactJson)
2626
{
2727
artifactJson["Permissions"] = new JsonObject()
2828
{
29-
["AllowedAtRoot"] = artifactJson["AllowedAtRoot"],
30-
["AllowedChildContentTypes"] = artifactJson["AllowedChildContentTypes"],
29+
["AllowedAtRoot"] = artifactJson["AllowedAtRoot"]?.DeepClone(),
30+
["AllowedChildContentTypes"] = artifactJson["AllowedChildContentTypes"]?.DeepClone(),
3131
};
3232

3333
return artifactJson;

src/Umbraco.Deploy.Contrib/Migrators/Legacy/DataType/PreValuesDataTypeArtifactJsonMigrator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public override JsonNode Migrate(JsonNode artifactJson)
2626

2727
foreach (var preValue in preValues)
2828
{
29-
var value = preValue.Value;
29+
var value = preValue.Value?.DeepClone();
3030

3131
// Convert pre-value serialized JSON to actual JSON objects/arrays
3232
if (value is JsonValue jsonValue &&

0 commit comments

Comments
 (0)