mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-16 01:05:07 +08:00
Corrected none null asumptions when altering exiting Content Types with new Parts
--HG-- branch : dev
This commit is contained in:
parent
9301e9eb0a
commit
3bf8517cb2
@ -33,7 +33,7 @@ namespace Orchard.Core.PublishLater.ViewModels {
|
|||||||
get { return IsPublished || ContentItem.ContentManager.Get(ContentItem.Id, VersionOptions.Published) != null; }
|
get { return IsPublished || ContentItem.ContentManager.Get(ContentItem.Id, VersionOptions.Published) != null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime? VersionPublishedUtc { get { return ContentItem.As<CommonAspect>().VersionPublishedUtc; } }
|
public DateTime? VersionPublishedUtc { get { return ContentItem.As<CommonAspect>() == null ? null : ContentItem.As<CommonAspect>().VersionPublishedUtc; } }
|
||||||
|
|
||||||
public DateTime? ScheduledPublishUtc { get; set; }
|
public DateTime? ScheduledPublishUtc { get; set; }
|
||||||
|
|
||||||
|
@ -63,10 +63,10 @@ namespace Orchard.Core.Routable.Services {
|
|||||||
public IEnumerable<IsRoutable> GetSimilarSlugs(string contentType, string slug)
|
public IEnumerable<IsRoutable> GetSimilarSlugs(string contentType, string slug)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
_contentManager.Query(contentType).Join<RoutableRecord>()
|
_contentManager.Query().Join<RoutableRecord>()
|
||||||
.List()
|
.List()
|
||||||
.Select(i => i.As<IsRoutable>())
|
.Select(i => i.As<IsRoutable>())
|
||||||
.Where(routable => routable.Path.Equals(slug, StringComparison.OrdinalIgnoreCase)) // todo: for some reason the filter doesn't work within the query, even without StringComparison or StartsWith
|
.Where(routable => routable.Path != null && routable.Path.Equals(slug, StringComparison.OrdinalIgnoreCase)) // todo: for some reason the filter doesn't work within the query, even without StringComparison or StartsWith
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user