3

Yesterday while working on my Sitecore 8.2 solution, I encountered a strange situation and I had to spend many hours on it.

For some very strange reason, one of the sitecore items when I was trying to browse from front-end was giving me layout not available. I immediately thought that it might be an accidental case of me forgetting to publish that item. So I published it again but when I went to the web database I noticed that that item absolutely had no presentation settings. I went back to test by adding some content to one of its fields, in the template standard values which when published did go through to web database but the presentation settings never got published. I then noticed one thing very peculiar.

When reviewing the presentation settings for the item in web database, I realized that the labels for default device, print device etc. were all displaying in japanese. Immediately I realized in my my multi-site definitions, I had in fact commented out the default "website" site definition in the config file as my intention was to always go to en-us site by default. Since the "hostName" attribute for all sites were the same, I thought that Sitecore might be reading the first site which was "ja-jp", and hence the japanese labels. But mind you, this was only happening on the web database. On master database the labels were all English.

So I put back the default "website" site definition in the config file and now when I went to web database I could see the English labels. I assumed that should be it and now even my publishing should be resolved (although I was still not sure of the relation between these two issues). But no, I was still not able to see the presentation settings of that one item and of it's standard value item. One thing to clear here is that throughout my endeavor, there were absolutely no sitecore errors in the logs.

As another try, I then started removing one by one of the presentation renderings of that item's standard value item and now when I published I could see those presentation settings on the web database. I then put all the original presentation setting rendering items back and published and now I could see them all in the published item in the web database. So, it seemed like it needed a "refresh" of the presentation settings of that item for them to get published. Very very strange indeed.

Also wanted to mention that even if I forcefully copied over the raw values of layout field over from master or use "Transfer" option from master, still this particular sitecore item's presentation settings were not published or visible on the web database.

More on this. I got the same issue again and upon further investigating, I noticed that the reason that the item missing its presentation settings was because the unicorn serialized file for the standard item of the template, was missing the rendering information. So I again did some change in the presentation settings, saved and re-serialized that template and now I was able to see the renderings in the item's standard value serialized file. I am absolutely not sure why this happened but this is a workaround if anyone else faces similar issue

1 Answer 1

2

First thing is never remove the "website" site definition. Just keep it after all of your custom site definition and don't remove it. It will/should be used as the fallback site definition in case any of the requests doesn't find any matching site definition in your custom sites.

Another thing is, Sitecore content editor uses the "shell" site definition to work and not the "website" site.

Another common mistake happen is, once you change the editor to "web" database and if you open a content editor without changing it back to "master" database from Sitecore desktop, then content editor will continue to use "web" database. Sometime people mistakenly do their changes on "web" database and once the publish is done those changes will be disappear again.

From the last paragraph you have explained, it seems that this issue is totally due to your unicorn settings. Sometimes unicorn files can go out of sync due to some reasons and you might have to re-serialize the node/item to get them back into sync.

Also I hope you understand that if you do these changes to unicorn sync items and didn't sync them back to your file repository, then next deployment to any of the servers can wipe out the changes you did.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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