Home > SharePoint, SharePoint 2010 > SharePoint 2010 Bug: Missing fields in my content type

SharePoint 2010 Bug: Missing fields in my content type


I thought it was worth mentioning what appears to be a bug in SharePoint 2010 that got me scratching my head for a while…

When creating a content type as shown below, if I include an XML comment inside the FieldRefs tag then I would find that all the fields specified for this content type were missing when it was deployed. It was really odd because I had two other content types inheriting from this which both had their fields but not those defined for this content type!

  <ContentType ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900 ...
d54be803546a4c7da74ae65449870345"
               Name="My Page"
               Group="My Group"
               Description="My Page"
               Inherits="TRUE"
               Version="0">
    <FieldRefs>
      <!-- This comment can prevent these fields from being added to this content type -->
      <FieldRef ID="{13481151-3988-47A9-9A38-D11643675212}" Name="MyField1" />
      <FieldRef ID="{35841543-F34E-A31F-BC32-B497C45A319C}" Name="MyField2" />
    </FieldRefs>
  </ContentType>

So if you encounter this problem, try removing the comments and you will probably find the fields will be there the next time you deploy the content type. I have tried moving the comments elsewhere within the FieldRefs tag but could not find anything that worked. Comments specified outside the ContentType tag were fine.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: