Small update to the localization service's GetLocalizations w/ a note to also query for scheduled items

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-13 11:31:39 -07:00
parent e4a20d7039
commit 9b925a2a85

View File

@@ -33,13 +33,15 @@ namespace Orchard.Core.Localization.Services {
IEnumerable<IContent> ILocalizationService.GetLocalizations(IContent content) {
var localized = content.As<Localized>();
//todo: (heskew) get scheduled content as well
if (localized.MasterContentItem != null)
return _contentManager.Query(content.ContentItem.ContentType).Join<LocalizedRecord>()
return _contentManager.Query(VersionOptions.Latest, content.ContentItem.ContentType).Join<LocalizedRecord>()
.List()
.Select(i => i.As<Localized>())
.Where(l => l.Id != content.ContentItem.Id && (l.Id == localized.MasterContentItem.ContentItem.Id || l.MasterContentItem != null && l.MasterContentItem.ContentItem.Id == localized.MasterContentItem.ContentItem.Id));
return _contentManager.Query(content.ContentItem.ContentType).Join<LocalizedRecord>()
return _contentManager.Query(VersionOptions.Latest, content.ContentItem.ContentType).Join<LocalizedRecord>()
.List()
.Select(i => i.As<Localized>())
.Where(l => l.MasterContentItem != null && l.MasterContentItem.ContentItem.Id == content.ContentItem.Id);