Posts

Showing posts from 2014

Always enforcing your sites single language in Sitecore

PROBLEM BACKGROUND Do you have a sitecore website that will exist in only one language? Have you checked what will happen if someone accesses your site passing the query string parameter sc_lang where sc_lang is set to a value your site doesn't support?   Your site might throw a 500 error, it could redirect the user to your custom error page or it could throw a yellow screen of death. Try your site out, see what happens.      You might be wondering why would this ever happen? I became aware of this issue when one of our designers tried to pass an unsupported language to the sc_lang parameter to see what would happen.   Our site redirected the user to our error page, showing no content. We all know malicious users exist.  If they find you are running a Sitecore instance, they can try to pass query string parameters to your site to see what happens. If they get the ysod they might get useful information. POTENTIAL RESOLUTION Keep in mind, Sitecore is working as des

Handling the situation where scItemPath does not exist in Sitecore MVC

What happens if the scItemPath specified in your route does not exist in Sitecore? In this post i'm going to discuss how I handle this situation. Here is a sample route from Sitecore's MVC documentation .   (see Section 4.1) // matches the item '/home/blogPosts/{blogNo}' routes.MapRoute("example2", "blog/{blogNo}", new { scItemPath = "/home/blogPosts/{blogNo}" }); But what happens when the blog number doesn't exist?   What page will Sitecore show?  What if the user has a link to an old blog post that you have archived or someone links to a blog post using the wrong number by accident? What I wanted was a new route value that specified where to go when the path resolved by scItemPath is not found.  So I created the scNoItemFound value. // matches the item '/home/blogPosts/{blogNo}' routes.MapRoute("example2", "blog/{blogNo}", new { scItemPath = "/

Why I chose Selenium WebDriver instead of Telerik's free testing framework

Telerik Testing Framework vs Selenium WebDriver In this post I will discuss why I chose  Selenium WebDriver instead of Telerik's Free Testing Framework . We are a Microsoft shop using C# and usually the latest version of Visual Studio.  I'm using nUnit because our build tool Bamboo easily intergrates with nUnit. Telerik Testing Framework Information First I want to say I love Telerik components.  My organization owns Telerik's Dev Craft suite and we use components from almost each toolkit.   Their components and support are wonderful.  I would recommend you check them out if you are in the market for high quality .NET components. The one component I am not using from the Telerik suite is their free testing framework .    Their testing framework allows you to automate web and wpf user interface testing.    The API is very rich as it has went through several iterations.   When you install the testing framework it gives you nice Visual Studio templates