Open orchardbot opened 11 years ago
joshby commented:
Submitted a pull request to fix.
https://orchard.codeplex.com/SourceControl/network/forks/joshby/orchard/contribution/7813
@sebastienros commented:
Can you still repro it on 1.x ?
tadeutorres commented:
It's stil happening in 1.x. Just tested it.
MediaLinkPartRecord just don't save in first try in a menuitem. Second time it saves normally.
I made a fix, seems to be working
[HttpPost, ActionName("CreateMenuItem")]
public ActionResult CreateMenuItemPost(string id, int menuId, string returnUrl) {
if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu")))
return new HttpUnauthorizedResult();
var menuItem = Services.ContentManager.New(id);
if (menuItem == null)
return HttpNotFound();
// load the menu
var menu = Services.ContentManager.Get(menuId);
if (menu == null)
return HttpNotFound();
Services.ContentManager.Create(menuItem);
var model = Services.ContentManager.UpdateEditor(menuItem, this);
var menuPart = menuItem.As<MenuPart>();
menuPart.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
menuPart.Menu = menu;
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
return View(model);
}
Services.Notifier.Information(T("Your {0} has been added.", menuItem.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
}
@jetski5822 created: https://orchard.codeplex.com/workitem/20073
Create a new Menu Item... i.e.
Then go and add that menu item to your navigation menu populating the fields. Hit Save, return to that menu item and you will see those fields are not populated. Add the details again to the fields and save and all works as expected.