Skip to content

Commit

Permalink
Fixing that Core/Navigation/Controllers/AdminController changes from …
Browse files Browse the repository at this point in the history
…1.10.x were partially incompatible with dev

preventing the editor from saving MenuItem changes
  • Loading branch information
BenedekFarkas committed Apr 9, 2024
1 parent 151bb12 commit 441c6da
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.ContentManagement.Handlers;
using Orchard.Core.Contents.Settings;
using Orchard.Core.Navigation.Models;
using Orchard.Core.Navigation.Services;
using Orchard.Core.Navigation.ViewModels;
using Orchard.Data;
using Orchard.Exceptions;
using Orchard.Localization;
using Orchard.Logging;
using Orchard.Mvc.Extensions;
using Orchard.Mvc.Html;
using Orchard.UI;
using Orchard.UI.Notify;
using Orchard.UI.Navigation;
using Orchard.UI.Notify;
using Orchard.Utility;
using System;
using Orchard.ContentManagement.Handlers;
using Orchard.Logging;
using Orchard.Exceptions;
using Orchard.ContentManagement.Aspects;
using Orchard.Utility.Extensions;
using Orchard.Mvc.Html;
using Orchard.Core.Contents.Settings;
using Orchard.Data;
using System.Web.Routing;

namespace Orchard.Core.Navigation.Controllers {
[ValidateInput(false)]
Expand Down Expand Up @@ -249,13 +249,14 @@ public ActionResult Edit(int id) {
}

[HttpPost, ActionName("Edit")]
[Mvc.FormValueRequired("submit.Save")]
[Mvc.FormValueRequired("submit.Publish")]
public ActionResult EditPOST(int id, string returnUrl) {
return EditPOST(id, returnUrl, contentItem => {
if (!contentItem.Has<IPublishingControlAspect>() && !contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
_contentManager.Publish(contentItem);
});
}

private ActionResult EditPOST(int id, string returnUrl, Action<ContentItem> conditionallyPublish) {
var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired);

Expand Down

0 comments on commit 441c6da

Please sign in to comment.