From 885ec99cc48d4a3faa8becf8a87914f4a2390c92 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 11 Jul 2022 15:36:23 +0200 Subject: [PATCH] Fix breaking change in MenuItemList --- src/Umbraco.Core/Trees/MenuItemList.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Trees/MenuItemList.cs b/src/Umbraco.Core/Trees/MenuItemList.cs index 7ba2bae0f8..de926d54d8 100644 --- a/src/Umbraco.Core/Trees/MenuItemList.cs +++ b/src/Umbraco.Core/Trees/MenuItemList.cs @@ -24,6 +24,17 @@ public class MenuItemList : List : base(items) => _actionCollection = actionCollection; + /// + /// Adds a menu item with a dictionary which is merged to the AdditionalData bag + /// + /// + /// + /// The used to localize the action name based on its alias + /// Whether or not this action opens a dialog + /// Whether or not this action should use legacy icon prefixed with "icon-" or full icon name is specified. + public MenuItem? Add(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false) + where T : IAction => Add(textService, hasSeparator, opensDialog, useLegacyIcon: true); + /// /// Adds a menu item with a dictionary which is merged to the AdditionalData bag /// @@ -35,7 +46,7 @@ public class MenuItemList : List public MenuItem? Add(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false, bool useLegacyIcon = true) where T : IAction { - var item = CreateMenuItem(textService, hasSeparator, opensDialog); + MenuItem? item = CreateMenuItem(textService, hasSeparator, opensDialog, useLegacyIcon); if (item != null) { Add(item);