Permalink
Browse files

Fixing "Undo Changes" action not working for page folder data types

  • Loading branch information...
napernik committed Sep 29, 2017
1 parent 6229a81 commit a7e09cbef5b9b9d3cca502ea78047d749df20b3a
@@ -397,19 +397,12 @@ public List<ElementAction> GetActions(IData data, Type elementProviderType)
if (publishControlled.PublicationStatus == Draft)
{
if (ProcessControllerAttributesFacade.IsActionIgnored(elementProviderType, GenericPublishProcessControllerActionTypeNames.UndoUnpublishedChanges) == false)
if (!ProcessControllerAttributesFacade.IsActionIgnored(elementProviderType, GenericPublishProcessControllerActionTypeNames.UndoUnpublishedChanges))
{
ActionToken actionToken;
IActionTokenProvider actionTokenProvider = ProcessControllerAttributesFacade.GetActionTokenProvider(elementProviderType, GenericPublishProcessControllerActionTypeNames.UndoUnpublishedChanges);
if (actionTokenProvider != null)
{
actionToken = actionTokenProvider.GetActionToken(GenericPublishProcessControllerActionTypeNames.UndoUnpublishedChanges, data);
}
else
{
actionToken = new UndoPublishedChangesActionToken();
}
var actionToken = actionTokenProvider?.GetActionToken(GenericPublishProcessControllerActionTypeNames.UndoUnpublishedChanges, data)
?? new UndoPublishedChangesActionToken();
var undoPublishedChangesAction = new ElementAction(new ActionHandle(actionToken))
{
@@ -3,6 +3,7 @@
using Composite.Data.ProcessControlled.ProcessControllers.GenericPublishProcessController;
using Composite.C1Console.Security;
using Composite.C1Console.Workflow;
using Composite.Data.Types;
namespace Composite.Plugins.Elements.ElementProviders.PageElementProvider
@@ -14,7 +15,9 @@ public ActionToken GetActionToken(string actionTypeName, IData data)
switch (actionTypeName)
{
case GenericPublishProcessControllerActionTypeNames.UndoUnpublishedChanges:
return new WorkflowActionToken(WorkflowFacade.GetWorkflowType("Composite.Plugins.Elements.ElementProviders.PageElementProvider.UndoUnpublishedChangesWorkflow"), PageElementProvider.EditPermissionTypes);
return data is IPage
? new WorkflowActionToken(WorkflowFacade.GetWorkflowType("Composite.Plugins.Elements.ElementProviders.PageElementProvider.UndoUnpublishedChangesWorkflow"), PageElementProvider.EditPermissionTypes)
: null;
default:
return null;

0 comments on commit a7e09cb

Please sign in to comment.