mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-18 17:47:54 +08:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user