Additional fix for U4-2105 Saving a document will make it look like it is unpublished
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user