WSS Content Type Was Not Updated

I tried to update a content type in WSS, but the system was still using the older version of content type somehow. After two-day frustration, I found out why :(

Here was what happened in the beginning: I created a simple content type like below:

<ContentType ID="0x01080100B7336179CFFE43e59B86E241C767010E" Name="GradingTask" Group="Grading" Description="Grading Task" Version="0" Hidden="FALSE">
</ContentType>


The content type worked perfectly and I added several items of GradingTask type to a list. Then I thought: How about adding custom Edit/Display pages? So I added these lines to the configuration:

<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
<FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
<Edit>_layouts/Grades/GradesTaskEditForm.aspx</Edit>
<Display>_layouts/Grades/GradesTaskEditForm.aspx</Display>
</FormUrls>
</XmlDocument>
</XmlDocuments>


After I installed the updated content type and tried to edit a task, WSS kept showing me the default EditForm.aspx page, not the GradesTaskEditForm.aspx. Then I tried to deactivate and uninstall the content type for many times, but WSS still used the default page.

Finally, I saw a line in the "Real World SharePoint 2007" book: When you use Feature to install a new version of Content Type, WSS does not support cascading update if inherited content type is used somewhere. (No quote)

Oh ... That is the reason why I failed to overwrite the old content type definition -- WSS kept GradingTask's meta data for the list even after the Feature was uninstalled.

So I deleted all items of that GradingTask type, removed workflow setting, detached the content type from the list, deactivated/uninstalled the feature, deleted the list and then reinstalled/activated the feature, ... ... finally my lovely custom Edit page showed up :)

According to the book, to support cascading update I need write code using WSS object model API to force cascading update ... I would try that later.

[Updated 12/28/2007] I saw this great article this morning to deal with the mess of Content Type inheritance.

1 comments:

digital signatures said...

Thanks for a great article. Your tips are accurate and they will be of great help to me with my business I bookmarked your site, will be back ! !