From 67771450797eb2c72449ddcabfc38d5ebf99c7f3 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 2 Nov 2023 08:45:27 +0100 Subject: [PATCH 1/3] Ensure that missing access rules do not break the site (#15081) --- src/Umbraco.Infrastructure/Persistence/Dtos/AccessDto.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Infrastructure/Persistence/Dtos/AccessDto.cs b/src/Umbraco.Infrastructure/Persistence/Dtos/AccessDto.cs index 354083dfa8..0821232826 100644 --- a/src/Umbraco.Infrastructure/Persistence/Dtos/AccessDto.cs +++ b/src/Umbraco.Infrastructure/Persistence/Dtos/AccessDto.cs @@ -37,5 +37,5 @@ internal class AccessDto [ResultColumn] [Reference(ReferenceType.Many, ReferenceMemberName = "AccessId")] - public List Rules { get; set; } = null!; + public List Rules { get; set; } = new(); } From ffaa77eb25b44304adeffcfa8976bbcb9c517716 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:54:16 +0100 Subject: [PATCH 2/3] Update correct action (#15142) --- .../Filters/ContentSaveValidationAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs index 7cf6ba3cf5..f2e61b694a 100644 --- a/src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs +++ b/src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs @@ -189,7 +189,7 @@ internal sealed class ContentSaveValidationAttribute : TypeFilterAttribute break; case ContentSaveAction.Schedule: permissionToCheck.Add(ActionUpdate.ActionLetter); - permissionToCheck.Add(ActionToPublish.ActionLetter); + permissionToCheck.Add(ActionPublish.ActionLetter); contentToCheck = contentItem.PersistedContent; contentIdToCheck = contentToCheck?.Id ?? default; break; From 9e5ff305c8a969856f27cf3f63f0e85ad3033e14 Mon Sep 17 00:00:00 2001 From: Sven Geusens Date: Tue, 7 Nov 2023 10:49:46 +0100 Subject: [PATCH 3/3] Batched bulk WhereIn query to avoid To mana paramaters error (#15004) Co-authored-by: Sven Geusens --- .../Implement/ContentTypeRepositoryBase.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs index 3e92a4ae7f..59aa92bb82 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs @@ -1385,10 +1385,15 @@ AND umbracoNode.id <> @id", } // Now bulk update the umbracoDocument table - foreach (IGrouping> editValue in editedDocument.GroupBy(x => x.Value)) + // we need to do this in batches as the WhereIn Npoco method translates to all the nodeIds being passed in as parameters when using the SqlClient provider + // this results in to many parameters (>2100) being passed to the client when there are a lot of documents being normalized + foreach (IGrouping> groupByValue in editedDocument.GroupBy(x => x.Value)) { - Database.Execute(Sql().Update(u => u.Set(x => x.Edited, editValue.Key)) - .WhereIn(x => x.NodeId, editValue.Select(x => x.Key))); + foreach (IEnumerable> batch in groupByValue.InGroupsOf(2000)) + { + Database.Execute(Sql().Update(u => u.Set(x => x.Edited, groupByValue.Key)) + .WhereIn(x => x.NodeId, batch.Select(x => x.Key))); + } } }