Merge remote-tracking branch 'origin/release/15.4' into v15/dev

This commit is contained in:
Jacob Overgaard
2025-04-16 14:47:02 +02:00
12 changed files with 280 additions and 38 deletions

View File

@@ -1,8 +1,10 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Core.Scoping;
using Umbraco.Cms.Core.Services.OperationStatus;
@@ -35,6 +37,21 @@ internal sealed class ContentBlueprintEditingService
return await Task.FromResult(blueprint);
}
public Task<IContent?> GetScaffoldedAsync(Guid key)
{
IContent? blueprint = ContentService.GetBlueprintById(key);
if (blueprint is null)
{
return Task.FromResult<IContent?>(null);
}
using ICoreScope scope = CoreScopeProvider.CreateCoreScope();
scope.Notifications.Publish(new ContentScaffoldedNotification(blueprint, blueprint, Constants.System.Root, new EventMessages()));
scope.Complete();
return Task.FromResult<IContent?>(blueprint);
}
public async Task<Attempt<PagedModel<IContent>?, ContentEditingOperationStatus>> GetPagedByContentTypeAsync(Guid contentTypeKey, int skip, int take)
{
IContentType? contentType = await ContentTypeService.GetAsync(contentTypeKey);

View File

@@ -8,6 +8,8 @@ public interface IContentBlueprintEditingService
{
Task<IContent?> GetAsync(Guid key);
Task<IContent?> GetScaffoldedAsync(Guid key) => Task.FromResult<IContent?>(null);
Task<Attempt<PagedModel<IContent>?, ContentEditingOperationStatus>> GetPagedByContentTypeAsync(
Guid contentTypeKey,
int skip,