I've encountered the strangest problem. I've got two features:
ContentTypes
: contains a couple of custom fields and a content type (based on plain ol'0x01
) calledWithdrawals
that uses them. Scoped to Site.Registration
: contains aListTemplate
and aListInstance
that just modifies a basic Custom List to enable content types and add my custom content type. Scoped to Web.
Here's what's happening. When I activate ContentTypes
, the content type and field are deployed as expected into my site collection. When I activate Registration
, the list is provisioned and the content type is added as expected.
When I try to add a new item to the list, the list form only shows the Title field from Item. Now, here's the weird part. If I add a second content type to the list (through the UI), the list form suddenly works correctly. This makes me think there's something wrong with my content type. Here's what I'm working with. Some names have been changed to protect the innocent.
<ContentType ID="0x0100B4366B5F6383463b8464DBD2EDD5E097"
Name="Withdrawal"
Description="Record of a team withdrawal"
Hidden="False">
<FieldRefs>
<FieldRef ID="{CE8F7528-E643-4473-94E0-BAA57BD2F6E6}"/>
<FieldRef ID="{E508D1FA-D3A5-4e91-828B-3BFB43D4F7C5}"/>
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<Display>ListForm</Display>
<Edit>ListForm</Edit>
<New>ListForm</New>
</FormTemplates>
</XmlDocument>
</XmlDocuments>
And here are the relevant bits of SCHEMA.XML:
<List xmlns:ows="Microsoft SharePoint" Title="Withdrawals" FolderCreation="FALSE" Direction="LTR" Url="Lists/Withdrawals" EnableContentTypes="TRUE" BaseType="0">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x0100B4366B5F6383463b8464DBD2EDD5E097" />
<ContentTypeRef ID="0x0120" />
</ContentTypes>
<Fields>
<Field ID="{CE8F7528-E643-4473-94E0-BAA57BD2F6E6}" Name="TeamName" StaticName="TeamName" DisplayName="Team Name" Type="Text">
</Field>
<Field ID="{E508D1FA-D3A5-4e91-828B-3BFB43D4F7C5}" Name="WithdrawalComments" StaticName="WithdrawalComments" DisplayName="Withdrawal Comments" Type="Note">
</Field>
</Fields>
It's also been added to the ViewFields
in the two default views. What the heck am I doing wrong here?