Skip to content

Commit 885ec99

Browse files
committedJul 11, 2022
Fix breaking change in MenuItemList
1 parent 942c4b3 commit 885ec99

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎src/Umbraco.Core/Trees/MenuItemList.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ public MenuItemList(ActionCollection actionCollection, IEnumerable<MenuItem> ite
2424
: base(items) =>
2525
_actionCollection = actionCollection;
2626

27+
/// <summary>
28+
/// Adds a menu item with a dictionary which is merged to the AdditionalData bag
29+
/// </summary>
30+
/// <typeparam name="T"></typeparam>
31+
/// <param name="hasSeparator"></param>
32+
/// <param name="textService">The <see cref="ILocalizedTextService" /> used to localize the action name based on its alias</param>
33+
/// <param name="opensDialog">Whether or not this action opens a dialog</param>
34+
/// <param name="useLegacyIcon">Whether or not this action should use legacy icon prefixed with "icon-" or full icon name is specified.</param>
Has conversations. Original line has conversations.
35+
public MenuItem? Add<T>(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false)
36+
where T : IAction => Add<T>(textService, hasSeparator, opensDialog, useLegacyIcon: true);
37+
2738
/// <summary>
2839
/// Adds a menu item with a dictionary which is merged to the AdditionalData bag
2940
/// </summary>
@@ -35,7 +46,7 @@ public MenuItemList(ActionCollection actionCollection, IEnumerable<MenuItem> ite
3546
public MenuItem? Add<T>(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false, bool useLegacyIcon = true)
3647
where T : IAction
3748
{
38-
var item = CreateMenuItem<T>(textService, hasSeparator, opensDialog);
49+
MenuItem? item = CreateMenuItem<T>(textService, hasSeparator, opensDialog, useLegacyIcon);
3950
if (item != null)
4051
{
4152
Add(item);

0 commit comments

Comments
 (0)
Please sign in to comment.