diff --git a/libs/net/dal/Services/ReportService.cs b/libs/net/dal/Services/ReportService.cs index c7bf93be3..ee45d6bd9 100644 --- a/libs/net/dal/Services/ReportService.cs +++ b/libs/net/dal/Services/ReportService.cs @@ -827,7 +827,7 @@ public IEnumerable GetLatestInstances(int id, int? ownerId = nul if (sectionSettings.RemoveDuplicates) query = query.Where(fc => !excludeAboveSectionContentIds.Contains(fc.ContentId)); - if (excludeContentIds.Any() && !sectionSettings.OverrideExcludeHistorical) + if (excludeContentIds.Any()) query = query.Where(fc => !excludeContentIds.Contains(fc.ContentId)); var content = query @@ -851,9 +851,9 @@ public IEnumerable GetLatestInstances(int id, int? ownerId = nul // Modify the query to exclude content. var excludeOnlyTheseContentIds = excludeContentIds.Any() && !sectionSettings.OverrideExcludeHistorical ? excludeContentIds : Array.Empty(); - var excludeAboveAndHistorical = sectionSettings.RemoveDuplicates + var excludeAboveAndHistorical = sectionSettings.OverrideExcludeHistorical ? excludeOnlyTheseContentIds.AppendRange(excludeAboveSectionContentIds).Distinct().ToArray() - : Array.Empty(); + : excludeOnlyTheseContentIds; var query = excludeAboveAndHistorical.Any() ? section.Filter.Query.AddExcludeContent(excludeAboveAndHistorical) : section.Filter.Query;