Deal with some FIXME
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using Umbraco.Core;
|
||||
@@ -29,7 +28,7 @@ namespace Umbraco.Web.WebServices
|
||||
|
||||
if (publishDescendants == false)
|
||||
{
|
||||
content.PublishCulture(); // fixme variants? validation - when this returns null?
|
||||
// fixme variants?
|
||||
var result = Services.ContentService.SaveAndPublish(content, userId: Security.CurrentUser.Id);
|
||||
return Json(new
|
||||
{
|
||||
@@ -40,12 +39,12 @@ namespace Umbraco.Web.WebServices
|
||||
else
|
||||
{
|
||||
// fixme variants?
|
||||
var result = Services.ContentService.SaveAndPublishBranch(content, includeUnpublished);
|
||||
var result = Services.ContentService.SaveAndPublishBranch(content, includeUnpublished).ToArray();
|
||||
|
||||
return Json(new
|
||||
{
|
||||
success = result.All(x => x.Success),
|
||||
message = GetMessageForStatuses(result.ToArray(), content)
|
||||
message = GetMessageForStatuses(result, content)
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -79,19 +78,19 @@ namespace Umbraco.Web.WebServices
|
||||
return Services.TextService.Localize("publish/nodePublish", new[] { status.Content.Name});
|
||||
case PublishResultType.FailedPathNotPublished:
|
||||
return Services.TextService.Localize("publish/contentPublishedFailedByParent",
|
||||
new [] { string.Format("{0} ({1})", status.Content.Name, status.Content.Id) });
|
||||
new [] { $"{status.Content.Name} ({status.Content.Id})" });
|
||||
case PublishResultType.FailedHasExpired:
|
||||
case PublishResultType.FailedAwaitingRelease:
|
||||
case PublishResultType.FailedIsTrashed:
|
||||
return "Cannot publish document with a status of " + status.Result;
|
||||
case PublishResultType.FailedCancelledByEvent:
|
||||
return Services.TextService.Localize("publish/contentPublishedFailedByEvent",
|
||||
new [] { string.Format("'{0}' ({1})", status.Content.Name, status.Content.Id) });
|
||||
new [] { $"'{status.Content.Name}' ({status.Content.Id})" });
|
||||
case PublishResultType.FailedContentInvalid:
|
||||
return Services.TextService.Localize("publish/contentPublishedFailedInvalid",
|
||||
new []{
|
||||
string.Format("'{0}' ({1})", status.Content.Name, status.Content.Id),
|
||||
string.Format("'{0}'", string.Join(", ", status.InvalidProperties.Select(x => x.Alias)))
|
||||
$"'{status.Content.Name}' ({status.Content.Id})",
|
||||
$"'{string.Join(", ", status.InvalidProperties.Select(x => x.Alias))}'"
|
||||
});
|
||||
default:
|
||||
return status.Result.ToString();
|
||||
|
||||
Reference in New Issue
Block a user