Skip to main content
Formatting
Source Link
Richard Seal
  • 20.8k
  • 5
  • 44
  • 79

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.

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\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

     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, '\\'));

     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

     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, '\\'));

     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

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

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

Source Link
Vlad Iobagiu
  • 18.8k
  • 2
  • 27
  • 53

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