Friday, 20 July 2018

Sitecore Experience Editor and General Link Field encoding


This is a quick post I wanted to publish in which I will explain a weird issue happened with one of our clients, actually it took time to figure it out, imagine that sometimes and without any known scenario you lose” data from master database on a production environment! “Lose data”? yes, a general link fields suddenly become empty, and after publishing you will have issues on live! You want to know how, when, why, please completed reading.







A client of us reported that sometimes a sitecore item that has a couple of general fields lose its fields values, and when click on “insert Link” to fix the issue, they got an error message (see the following screenshot when you click on insert link), the website manager only notices the problem when it become live.



In last update field we saw as someone is editing the item, but every time this happened a different user is involved, checking log files showed that the item is being editing with other item being edited! So, as a first solution, we limited write access to only admin user and we removed all other roles from being able to edit this sitecore item. The issue seems to be solved but after a while we noticed that this is happened again 😊

This time an admin user is the one editing the item as logs and statistics last update by field is showing, checking with the user and he was editing another item using Experience Editor (EE); At this moment we caught the issue.

So, we are adding these fields as editable link through experience editor and once editing any page that contains these links, EE will also edit these links within the saved page, and in this save/edit process EE will change the encoding of the links and cause issue with general links fields, following is an example:

Original value (From Raw Value):
http://www.google.com/?q1=1&q2=2

Updated value (From Raw Value):
http://www.google.com/?q1=1&q2=2

From the above, you can see how EE changed the encoding for the & operator for an external link query string, causing the general link field to not being able to translate/understand the link which cause an error, publish the sitecore item to web database will cause these links to disappear from your front-end website.

Now the solution, Talking to sitecore support results into identified this behavior as a known issue in Sitecore 8.1 and 8.2, following is the related patch fixing URL, hope it will help someone BUT it doesn’t hurt to go back to Sitecore support before applying it:

Thanks for reading!

1 comment:

sri said...

Thanks for sharing this.,
Leanpitch provides online training in Scrum Master during this lockdown period everyone can use it wisely.
Join Leanpitch 2 Days CSM Certification Workshop in different cities.

CSM training online

Post a Comment