Fixes issues with creation of documents from blueprints that have populated file upload properties (#19655)

* Fixes issue where content created from blueprint would not persist file upload property values.

* Ensure a copy of a file upload is created when scaffolding content from a blueprint, like we do when copying content.

* Clarified comment.

* Removed unneeded usings.

* Fixed spelling.

* Handle create of blueprint from content to create a new uploaded file.
Handle delete of blueprint to delete uploaded files.
This commit is contained in:
Andy Butland
2025-07-07 14:15:17 +02:00
committed by GitHub
parent 4c87cc5fd9
commit b5195ed8eb
14 changed files with 314 additions and 340 deletions

View File

@@ -96,7 +96,7 @@ internal sealed class ContentServiceTests : UmbracoIntegrationTestWithContent
blueprint.SetValue("keywords", "blueprint 3");
blueprint.SetValue("description", "blueprint 4");
ContentService.SaveBlueprint(blueprint);
ContentService.SaveBlueprint(blueprint, null);
var found = ContentService.GetBlueprintsForContentTypes().ToArray();
Assert.AreEqual(1, found.Length);
@@ -121,7 +121,7 @@ internal sealed class ContentServiceTests : UmbracoIntegrationTestWithContent
blueprint.SetValue("keywords", "blueprint 3");
blueprint.SetValue("description", "blueprint 4");
ContentService.SaveBlueprint(blueprint);
ContentService.SaveBlueprint(blueprint, null);
ContentService.DeleteBlueprint(blueprint);
@@ -148,7 +148,7 @@ internal sealed class ContentServiceTests : UmbracoIntegrationTestWithContent
ContentService.Save(originalPage);
var fromContent = ContentService.CreateBlueprintFromContent(originalPage, "hello world");
ContentService.SaveBlueprint(fromContent);
ContentService.SaveBlueprint(fromContent, originalPage);
Assert.IsTrue(fromContent.HasIdentity);
Assert.AreEqual("blueprint 1", fromContent.Properties["title"]?.GetValue());
@@ -176,7 +176,7 @@ internal sealed class ContentServiceTests : UmbracoIntegrationTestWithContent
{
var blueprint =
ContentBuilder.CreateTextpageContent(i % 2 == 0 ? ct1 : ct2, "hello" + i, Constants.System.Root);
ContentService.SaveBlueprint(blueprint);
ContentService.SaveBlueprint(blueprint, null);
}
var found = ContentService.GetBlueprintsForContentTypes().ToArray();

View File

@@ -116,7 +116,7 @@ internal sealed class TelemetryProviderTests : UmbracoIntegrationTest
blueprint.SetValue("keywords", "blueprint 3");
blueprint.SetValue("description", "blueprint 4");
ContentService.SaveBlueprint(blueprint);
ContentService.SaveBlueprint(blueprint, null);
var fromBlueprint = await ContentBlueprintEditingService.GetScaffoldedAsync(blueprint.Key);
Assert.IsNotNull(fromBlueprint);