From f617a52ed73f8d230f907f2d0269e8f2a0c703ef Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Sat, 5 Aug 2023 13:45:35 +0300 Subject: [PATCH] Prevent calling `UpdateMany` when tehre is no changes --- .../Volo/CmsKit/Menus/PageChangedHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Menus/PageChangedHandler.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Menus/PageChangedHandler.cs index 0c8d53d071..68d51841dd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Menus/PageChangedHandler.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Menus/PageChangedHandler.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; @@ -31,6 +32,11 @@ public class PageChangedHandler : .Where(x => x.PageId == eventData.Entity.Id) .ToArray(); + if (affectedMenuItems.IsNullOrEmpty()) + { + return; + } + foreach (var menuItem in affectedMenuItems) { MenuManager.SetPageUrl(menuItem, eventData.Entity);