Additional fix for U4-2105 Saving a document will make it look like it is unpublished

This commit is contained in:
Sebastiaan Janssen
2013-04-15 07:33:26 -02:00
parent 7f6d8b6bdd
commit eb2db791b8
3 changed files with 5 additions and 4 deletions

View File

@@ -51,7 +51,8 @@ namespace Umbraco.Core.Persistence.Factories
UpdateDate = dto.ContentVersionDto.VersionDate,
ExpireDate = dto.ExpiresDate.HasValue ? dto.ExpiresDate.Value : (DateTime?)null,
ReleaseDate = dto.ReleaseDate.HasValue ? dto.ReleaseDate.Value : (DateTime?)null,
Version = dto.ContentVersionDto.VersionId
Version = dto.ContentVersionDto.VersionId,
PublishedState = dto.Published ? PublishedState.Published : PublishedState.Unpublished
};
}

View File

@@ -1383,8 +1383,8 @@ namespace Umbraco.Core.Services
{
content.WriterId = userId;
//Only change the publish state if the "previous" version was actually published
if (changeState && content.Published)
//Only change the publish state if the "previous" version was actually published or marked as unpublished
if (changeState && (content.Published || ((Content)content).PublishedState == PublishedState.Unpublished))
content.ChangePublishedState(PublishedState.Saved);
repository.AddOrUpdate(content);

View File

@@ -972,7 +972,7 @@ namespace umbraco.cms.businesslogic.web
[Obsolete("Obsolete, Instead of calling this just check if the latest version of the content is published", false)]
public bool HasPendingChanges()
{
return Content.Published == false;
return Content.Published == false && ((Umbraco.Core.Models.Content)Content).PublishedState != PublishedState.Unpublished;
}
/// <summary>