Fixed editContent.aspx to let the business logic handle the property validation when trying to publish and show the correct status message result (if it was not publishable). Adds the invalid properties collection to the PublishStatus so those can be shown too.

This commit is contained in:
Shannon
2013-07-24 12:54:10 +10:00
parent 4d39ce1202
commit 7f4abb4893
9 changed files with 102 additions and 58 deletions

View File

@@ -1027,11 +1027,12 @@ namespace umbraco.cms.businesslogic.web
}
/// <summary>
/// Saves and publishes a document
/// Do not use! only used internally in order to get the published status until we upgrade everything to use the new API
/// </summary>
/// <param name="u">The usercontext under which the action are performed</param>
/// <param name="u"></param>
/// <returns></returns>
public bool SaveAndPublish(User u)
[Obsolete("Do not use! only used internally in order to get the published status until we upgrade everything to use the new API")]
internal Attempt<PublishStatus> SaveAndPublishWithResult(User u)
{
foreach (var property in GenericProperties)
{
@@ -1065,13 +1066,24 @@ namespace umbraco.cms.businesslogic.web
//Now we need to fire the After publish event
FireAfterPublish(publishArgs);
return result.Success;
return result;
}
return false;
return Attempt<PublishStatus>.False;
}
return false;
return Attempt<PublishStatus>.False;
}
/// <summary>
/// Saves and publishes a document
/// </summary>
/// <param name="u">The usercontext under which the action are performed</param>
/// <returns></returns>
public bool SaveAndPublish(User u)
{
var result = SaveAndPublishWithResult(u);
return result.Success;
}
[Obsolete("Obsolete, Use Umbraco.Core.Services.ContentService.HasPublishedVersion()", false)]