From 1b58e7a59e064e7912758c31c1b842985c1fa4fb Mon Sep 17 00:00:00 2001 From: Berg Date: Sat, 30 Oct 2021 09:17:06 +0200 Subject: [PATCH] Fixes issue where PublishedContentQuery executes skip twice. So if the query returns 4 resuls, and you have skip =1 take=5, you only had 2 results. This is fixed in this commit. --- src/Umbraco.Infrastructure/PublishedContentQuery.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/PublishedContentQuery.cs b/src/Umbraco.Infrastructure/PublishedContentQuery.cs index e149e092d849..d8119f919c71 100644 --- a/src/Umbraco.Infrastructure/PublishedContentQuery.cs +++ b/src/Umbraco.Infrastructure/PublishedContentQuery.cs @@ -295,7 +295,7 @@ public IEnumerable Search(string term, int skip, int take totalRecords = results.TotalItemCount; return new CultureContextualSearchResults( - results.Skip(skip).ToPublishedSearchResults(_publishedSnapshot.Content), _variationContextAccessor, + results.ToPublishedSearchResults(_publishedSnapshot.Content), _variationContextAccessor, culture); } @@ -324,7 +324,7 @@ public IEnumerable Search(IQueryExecutor query, int skip, totalRecords = results.TotalItemCount; - return results.Skip(skip).ToPublishedSearchResults(_publishedSnapshot); + return results.ToPublishedSearchResults(_publishedSnapshot); } ///