YSOD in Sitecore Template Inheritance Tab

I received a nasty surprise, a YSOD, when I clicked the Inheritance tab for a user defined template in Sitecore. After a little digging and some help from Sitecore Rocks, it turns out that after installing a “dirty” Sitecore package, the Type for a field can be left blank. If you have a Sitecore template that inherits a template with a field that has a blank Type, you’ll see this:

ysod_fieldTypeItem

Since my Page template inherited from several templates that then also had inheritance, it was better to write a query to find the culprit. This is where Sitecore Rocks comes in really handy. I wrote the following  query to find any fields that had a blank Type:

select @@Path as Path, @@Name as Name, @Type as Type
from /sitecore/templates/User Defined/ParkSites//*[@@TemplateKey = 'template field' and @Type='']

This reduced a time heavy manual search down to seconds. I found my culprit, set his Type and fixed my YSOD!

Leave a Reply