From 37b33641c3ea2c75d9b89eea94e3ab157e0826aa Mon Sep 17 00:00:00 2001 From: Mole Date: Fri, 25 Nov 2022 11:37:46 +0100 Subject: [PATCH] V11: Fix ordering by published in list of content (#13474) * Update sort statement to use published field for invariant content * Order by published if invariant --- .../Repositories/Implement/DocumentRepository.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DocumentRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DocumentRepository.cs index bada35623b..5c7488401f 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DocumentRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DocumentRepository.cs @@ -152,20 +152,15 @@ public class DocumentRepository : ContentRepositoryBase(x => x.Published); } // invariant: left join will yield NULL and we must use pcv to determine published // variant: left join may yield NULL or something, and that determines published - Sql joins = Sql() .InnerJoin("ctype").On( (content, contentType) => content.ContentTypeId == contentType.NodeId, aliasRight: "ctype") @@ -185,9 +180,9 @@ public class DocumentRepository : ContentRepositoryBase(x => x.Published)}) ELSE (CASE WHEN ccvp.id IS NULL THEN 0 ELSE 1 END) END) AS ordering "); // trailing space is important! sql = Sql(sqlText, sql.Arguments);