mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#19783: Handling the case when there's no Url state for a newly created Redirect activity.
Work Item: 19783 --HG-- branch : 1.x extra : amend_source : 4434580d74e0b1c231009df5790b56a465352c95
This commit is contained in:
@@ -16,7 +16,8 @@ namespace Orchard.Workflows.Activities {
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public override bool CanExecute(WorkflowContext workflowContext, ActivityContext activityContext) {
|
||||
return true;
|
||||
var url = activityContext.GetState<string>("Url");
|
||||
return !string.IsNullOrWhiteSpace(url);
|
||||
}
|
||||
|
||||
public override IEnumerable<LocalizedString> GetPossibleOutcomes(WorkflowContext workflowContext, ActivityContext activityContext) {
|
||||
@@ -38,7 +39,7 @@ namespace Orchard.Workflows.Activities {
|
||||
}
|
||||
|
||||
public override LocalizedString Description {
|
||||
get { return T("Redirect to the specified URL."); }
|
||||
get { return T("Redirects to the specified URL."); }
|
||||
}
|
||||
|
||||
public override string Form {
|
||||
|
@@ -1,4 +1,8 @@
|
||||
<div>
|
||||
<div>@T("Redirect to {0}", Model.State.Url.Value)</div>
|
||||
</div>
|
||||
|
||||
@if (Model.State.Url != null && !String.IsNullOrWhiteSpace(Model.State.Url.Value)) {
|
||||
<div>@T("Redirect to {0}", Model.State.Url.Value)</div>
|
||||
}
|
||||
else {
|
||||
<div>@T("Redirect")</div>
|
||||
}
|
||||
</div>
|
Reference in New Issue
Block a user