Posts

Some thoughts on using Sitecore Habitat for Production codebase

Image
Habitat is considered as a demo project to highlight HELIX principles on practice. While Sitecore don’t recommend using it for Production codebase, many sitecoreans still use it as a base for their Sitecore platform projects. There are some people against this and there are lots of supporters. Main arguments of supporters would be that Habitat looks good, have lots of inbuilt functionality and is continuously developed by GitHub community.  Opponents claim that it is bad of using something that is not recommended by the platform vendor. Apart from having some great features, habitat project comes with a set of npm/gulp scripts and free item synchronization framework (unicorn) that allows companies who are building their websites on Sitecore to save costs on early stages of a project. Your dev team would be grateful for having dev setup/deploy scripts that actually work from first attempt (assuming you have the right version of npm and gulp J ). Your finance director w

Sitecore + Social Connected 2.1 + Twitter. System.OverflowException issue with TweetSharp library

You setup Social Connected module and configured your twitter app correctly? Getting authError parameter in the URL and System.OverflowException error in the log file? You’re definitely having an old TweetSharp library that causing this issue. Social Connected 2.1 uses TweetSharp library to communicate to Twitter API and there is a breaking change in twitter with user id that isn't targeted by this version of Social Connected. If you are running on SiteCore 7.2+ platform - you're safe as you can use 3.0 version which addresses the issue. If you're running on Sitecore up to 7.2, then you're in a little trouble, but don't worry too much as you can apply the following fix (at your own risk though :) ) Download Social Connected 3.0 Don't install it! Unpack the package Find TweetSharp.dll in the package and copy it over to your S itecore bin folder  Enjoy!

SharePoint uses Post method to display provider-hosted app in iframe

Classic book example for the simple MVC application doesn't work if you want to display it as provider hosted app in SharePoint! By classic, I mean situation where you have 2 Controller's actions with the same name, but for different HttpMethods: Get and Post. You use "Get" to display information to a user and "Post" to retrieve updated information back from the user. For example, EditProduct "Get" action will return some product information, and EditProduct "Post" action will receive updated model from the view and presumably save it to the DB. It gets tricky with SharePoint - it always sends HttpPost to your Controller, so EditProduct "Post" action gets hit. The only workaround I found so far (I don't have that extensive experience with MVC as I have with WebForms) is to simply rename EditProduct "Post" action to SaveProduct and explicitly set Form action to "SaveProduct".

Restore Sitecore master DB doesn't restore items state

If you just need an answer - go to the last paragraph! :) Otherwise, you can read the full story how I found the solution. Today, I come across an interesting issue with Sitecore master database. I made some changes to the content tree and later on I decided to revert them and reset master database state to initial state. So, I asked my team to restore master db to the previous backup (that was taken a day ago). After a restore had been finished, we verified Content Editor and were so surprised to see items that we added just today. These changes shouldn't be there. So, I requested one more restore (just in case), I verified db backup file date - everything was alright, however changes still appeared in the Content Tree. So, I opened Items table in the Sitecore master database and then I understood what is wrong - these changes were not there, which means Sitecore takes them from somewhere else. Sitecore tends to cache a lot of information, so when you restore its' Master

SharePoint delegate control is rendered twice

One of the situations where this might happen is - you deployed your control using one feature scope (Site for example) and than redeployed with another one (Web). So, you will see the control added twice to you pages. To fix this, simply: 1). switch to another feature scope (the one you no longer want to use), 2). deploy the feature, 3). deactivate it, 4). switch feature scope to the required one and redeploy it Enjoy!

Client-side scripting for Taxonomy/Term Set Fields

    I haven’t found any way of how to attach to onchange event of term store fields for the edit/new forms, so I had to spend a couple of hours on reverse engineering of WebTaggingDialog.js and ScriptForWebTaggingUI.js and in piece of HTML which represents SharePoint FormField for Taxonomy field.      So, in HTML this field is bound as a set of spans, divs, hidden field and image to open WebTaggingDialog.aspx:   < SPAN id =ctl00_MyTaxonomyFieldID_ctl00_ctl00>     < INPUT id =ctl00_MyTaxonomyFieldID_ctl00_ctl01 class ="ms-taxonomy ms-taxonomy-height ms-long" value =MyTaxonomyFieldValue|f0d123d1-ac8c-4a18-bccb-65c9b5ea83af type =hidden>     < DIV id =ctl00_MyTaxonomyFieldID_ctl00_ctl02 class ="ms-taxonomy ms-taxonomy-height ms-long" InputFieldId ="ctl00_MyTaxonomyFieldID_ctl00_ctl01" SspId ="68e138c4-5729-4ddd-ab0d-95c688c6c8eb" GroupId ="00000000-0000-0000-0000-000000000000" TermSetId ="14