-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menu item #1003
Menu item #1003
Conversation
…roller.cs Co-authored-by: Sára El-Saig <sara.el-saig@lombiq.com>
# Conflicts: # src/OrchardCore.Modules/OrchardCore.Menu/Controllers/AdminController.cs
@@ -270,7 +271,7 @@ public async Task<IActionResult> Delete(string menuContentItemId, string menuIte | |||
return NotFound(); | |||
} | |||
|
|||
var menuContentAsJson = (JsonObject)menu.Content; | |||
var menuContentAsJson = (JsonDynamicObject)menu.Content; | |||
// Look for the target menu item in the hierarchy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not need , see :
OrchardCore/src/OrchardCore/OrchardCore.Abstractions/Json/Dynamic/JsonDynamicObject.cs
Lines 162 to 164 in 7aab0f0
public static implicit operator JsonObject(JsonDynamicObject value) => value._jsonObject; | |
public static implicit operator JsonDynamicObject(JsonObject value) => new(value); |
@@ -280,8 +281,9 @@ public async Task<IActionResult> Delete(string menuContentItemId, string menuIte | |||
return NotFound(); | |||
} | |||
|
|||
var menuItems = menuContentAsJson[nameof(MenuItemsListPart)]["MenuItems"] as JsonArray; | |||
menuItems.Remove(menuItem); | |||
var menuItemsListPart = menuContentAsJson[nameof(MenuItemsListPart)] as JsonDynamicObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the original code
We add Remove and other functions just to keep untransformed code like menu.Content.Remove
working
No longer applicable. |
based on OrchardCMS#15500 (comment)