mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +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) {
|
IEnumerable<IContent> ILocalizationService.GetLocalizations(IContent content) {
|
||||||
var localized = content.As<Localized>();
|
var localized = content.As<Localized>();
|
||||||
|
|
||||||
|
//todo: (heskew) get scheduled content as well
|
||||||
|
|
||||||
if (localized.MasterContentItem != null)
|
if (localized.MasterContentItem != null)
|
||||||
return _contentManager.Query(content.ContentItem.ContentType).Join<LocalizedRecord>()
|
return _contentManager.Query(VersionOptions.Latest, content.ContentItem.ContentType).Join<LocalizedRecord>()
|
||||||
.List()
|
.List()
|
||||||
.Select(i => i.As<Localized>())
|
.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));
|
.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()
|
.List()
|
||||||
.Select(i => i.As<Localized>())
|
.Select(i => i.As<Localized>())
|
||||||
.Where(l => l.MasterContentItem != null && l.MasterContentItem.ContentItem.Id == content.ContentItem.Id);
|
.Where(l => l.MasterContentItem != null && l.MasterContentItem.ContentItem.Id == content.ContentItem.Id);
|
||||||
|
Reference in New Issue
Block a user