Checks if content has expired or is awaiting release before publishing
This commit is contained in:
@@ -2112,6 +2112,22 @@ namespace Umbraco.Core.Services
|
||||
content.Name, content.Id));
|
||||
return PublishStatusType.FailedPathNotPublished;
|
||||
}
|
||||
else if (content.ExpireDate.HasValue && content.ExpireDate.Value > DateTime.MinValue && DateTime.Now > content.ExpireDate.Value)
|
||||
{
|
||||
Logger.Info<ContentService>(
|
||||
string.Format(
|
||||
"Content '{0}' with Id '{1}' has expired and could not be published.",
|
||||
content.Name, content.Id));
|
||||
return PublishStatusType.FailedHasExpired;
|
||||
}
|
||||
else if (content.ReleaseDate.HasValue && content.ReleaseDate.Value > DateTime.MinValue && content.ReleaseDate.Value > DateTime.Now)
|
||||
{
|
||||
Logger.Info<ContentService>(
|
||||
string.Format(
|
||||
"Content '{0}' with Id '{1}' is awaiting release and could not be published.",
|
||||
content.Name, content.Id));
|
||||
return PublishStatusType.FailedAwaitingRelease;
|
||||
}
|
||||
|
||||
return PublishStatusType.Success;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user