mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-08 18:54:43 +08:00
Fixing RuntimeBinderException ("Cannot implicitly convert type 'Foo' to 'Newtonsoft.Json.Linq.JToken'") when adding a complex type to the workflow state.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Localization;
|
||||
@@ -30,7 +31,7 @@ namespace Orchard.Workflows.Models {
|
||||
}
|
||||
|
||||
public void SetState<T>(string key, T value) {
|
||||
State[key] = value;
|
||||
State[key] = JToken.FromObject(value);
|
||||
SerializeState();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user