0

I have an issue while previewing particular items. I am seeing the following error in the log files:

668 08:30:06 ERROR Bad JSON escape sequence: \A. Path 'ribbonUrl', line 1, position 290.
Exception: Newtonsoft.Json.JsonReaderException
Message: Bad JSON escape sequence: \A. Path 'ribbonUrl', line 1, position 290.
Source: Newtonsoft.Json
   at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote)
   at Newtonsoft.Json.JsonTextReader.ParseString(Char quote)
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   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.CreateValueInternal(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)

We are using Sitecore 8.1 Update 1.

  • Did you come up with a solution? – Filip Jönsson Sep 25 '17 at 9:31
3

This is a known issue in Sitecore 8 (as of Update-6) and Sitecore 8.1 (initial release). Making changes and clicking save will result in an error on the page:

enter image description here

and an error in the log:

54740 09:13:53 ERROR Bad JSON escape sequence: \a. Path 'r.d.r[22].rls.ruleset.rule[0].conditions.condition.@value', line 156, position 44.

This has to do with using rules which contain a "\" character in a condition's value.

Here is the workaround from Sitecore:

  1. Open the \Website\sitecore\shell\client\Sitecore\ExperienceEditor\Commands\Save.js file.
  2. Replace the following line in the execute:

    function (context) function: 
        context.currentContext.scLayout = Sitecore.ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value);
    

    with this line:

    context.currentContext.scLayout = Sitecore.ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value.replace(/\\/g, '\\\\'));
    

    For 8.1, the fix is slightly different, replacing:

    context.currentContext.scLayout = ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value);
    

    with this line:

    context.currentContext.scLayout = ExperienceEditor.Web.encodeHtml(window.parent.document.getElementById("scLayout").value.replace(/\\/g, '\\\\'));
    
  3. Save these changes and close the file.

  4. Clear your browser cache.

To track the future status of this Sitecore bug, please use the reference number 55394. More information about Sitecore public reference numbers can be found here.

The source : https://help.activecommerce.com/hc/en-us/articles/206474105--An-error-occurred-Bad-JSON-escape-sequence-in-Sitecore-8-x-Experience-Editor-Error

  • Thanks Sitecore Climber, I have tried this solution but still same issue – Sai Charan Medavarapu Dec 9 '16 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.