Friday, June 27, 2014

Content type has itself as parent on lists when “Inherit” attribute is not set

I have a custom content type with a custom list with said content type as primary.



Requirements dictates that the `Title` field should be replaced by another field - thus the content type does not inherit from its parent, i.e. does not have the `Inherit` attribute.



<ContentType ID="0x01000e40dca5144b49e6a969a143f4bcfb12"
Name="Due date"
Group="$Resources:MagicalProject,MagicalContentType_GroupName;"
Description=""
Version="0">
<FieldRefs>
<RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title"/>
<FieldRef ID="{542A76A6-C6BD-4AF4-BE26-FA5690450E03}" Name="NumberOfWorkDays" Required="TRUE"/> <!-- This is the replacement for "Title" -->
<FieldRef ID="{6D819DF3-A783-4026-B6E2-E6EAC6CA3B00}" Name="FormStepTaxHTField0"/>
<FieldRef ID="{6D819DF3-A783-4026-B6E2-E6EAC6CA3B01}" Name="ManagedMetadataFormStep" Required="TRUE"/>
</FieldRefs>
</ContentType>

In my list definition I set the above content type as the only content type associated with the list;



<ContentTypes>
<ContentTypeRef ID="0x01000e40dca5144b49e6a969a143f4bcfb12" />
</ContentTypes>

The deployment goes well as expected. The content type is successfully created and has the correct fieldrefs:



But when I then go to the list that is created with this content type, the view consists of nothing (i.e. no columns what so ever are displayed) and when I check the list settings I can see that the Due Date content type is indeed the primary one, but none of the fields are on the list. When I check the content type I can see it has itself as its parent with no columns:



As soon as I add the `Inherit="TRUE"` attribute it works, but has the `Title` field. I have multiple custom content types which are supposed to not have the `Title` field and they all have the same symptoms, so it's not a stand-alone issue.



Is this a bug from Microsoft's side or am I just missing something?


No comments:

Post a Comment