mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Localization: Fixing that LocalizationService.GetLocalizedContentItem should find translations within the group (#6931)
This commit is contained in:
parent
0cd7409a0f
commit
093be0ba77
@ -29,11 +29,13 @@ namespace Orchard.Localization.Services {
|
||||
if (localized == null)
|
||||
return null;
|
||||
|
||||
int masterContentItemId = localized.HasTranslationGroup ? localized.Record.MasterContentItemId : localized.Id;
|
||||
|
||||
// Warning: Returns only the first of same culture localizations.
|
||||
return _contentManager
|
||||
.Query<LocalizationPart>(versionOptions, content.ContentItem.ContentType)
|
||||
.Where<LocalizationPartRecord>(l =>
|
||||
(l.Id == content.ContentItem.Id || l.MasterContentItemId == content.ContentItem.Id)
|
||||
(l.Id == masterContentItemId || l.MasterContentItemId == masterContentItemId)
|
||||
&& l.CultureId == cultureRecord.Id)
|
||||
.Slice(1)
|
||||
.FirstOrDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user