I have a rendering that has a custom rendering parameters template. That rendering parameters template contains an image field. When I add the component to the page, add an image to the field, and try to save the page, I get the following error in the Sitecore log:
3200 13:40:13 ERROR After parsing a value an unexpected character was encountered: {. Path 'scLayout', line 1, position 2665.
Exception: Newtonsoft.Json.JsonReaderException
Message: After parsing a value an unexpected character was encountered: {. Path 'scLayout', line 1, position 2665.
Source: Newtonsoft.Json
at Newtonsoft.Json.JsonTextReader.ParsePostValue()
at Newtonsoft.Json.JsonTextReader.ReadInternal()
at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Sitecore.ExperienceEditor.Speak.Server.Requests.PipelineProcessorRequest`1.Process(RequestArgs requestArgs)
When I debug I get the following error in Visual Studio:
System.Web.HttpRequestValidationException occurred
Message: Exception thrown: 'System.Web.HttpRequestValidationException' in System.Web.dll
Additional information: A potentially dangerous Request.Form value was detected from the client (data="...und Image=<image mediaid="{04D...").
This seems to suggest that my Rendering Parameter value is not getting properly encoded before posting back to Sitecore. Is there any way to resolve this?
This is occurring in Sitecore 8.2 Initial Release.