We all know that content types, columns and list are the core or the “heart” of Sharepoint. I bet that there will be at least one content type or column that we need to create on every Sharepoint project we do.
I had a lot of problems before with MOSS 2007 especially when attaching a custom site content type on a list. When I tried to upgrade the site content type (ie. adding a field, etc), the content type attached on a list somehow is not updated. Yes we’ve got the “Update all content types inheriting from this type” but it never worked correctly. And worse, the list content type may get corrupted because of this!
When SP 2010 was first rumoured, I heard that the list content type is no longer a copy of the original. Therefore, any updates to the site content type will be guaranteed passed to ALL child content types attached to any list within the site/sub-sites.
Therefore, below is the list of tests I did (TITLE – EXPECTED RESULTS – ACTUAL RESULTS):
1. Deploy a content type feature using WSP – no error – no error.
2. Activate feature in site collection – content type is displayed in site content types – content type is displayed in site content type.
3. Adding site content type to a list – content type is added to the list together with the custom fields – content type is added to the list successfully together with the custom fields.
4. Adding a field to the site content type through Sharepoint GUI – field is added to ALL lists that are using that content type – ALL lists that are using that content type have the new field added successfully.
5. Modifying ContentTypes.xml feature manifest file in Visual Studio 2010 and adding a new field then re-deploy/upgrade the WSP – new field is NOT yet added until feature is de-activated and re-activated – new field does NOT appear just yet.
6. De-activating and re-activating content type feature – new field is added to the site content type and ALL lists inheriting from that content type – field is added ONLY on site content type, lists that inherit from it DO NOT have the new field!
7. Editing the list settings and add the new site column manually – site column is added to the content type successfully – received an error like below but the site columns is actually added successfully.
Unlike MOSS 2007, when I then tried to edit the properties of the newly added field after I received the above message, I could. In MOSS 2007 I simply couldn’t. The field is somehow corrupted.
Conclusion
Comparing to MOSS 2007, as far as content types and fields are concerned, there are a bit of improvements. At least I can now assure myself that content types and fields will not break as a result of feature deactivating/reactivating even if there are new fields added to it through either Sharepoint directly or Visual Studio WSP.
However, in terms of creating a copy of the content type on the list, it’s still the same. If you mouse over on the list content type you’ll be able to see your original content type ID + 00 + new GUID (ie. a copy of the content type). See below:
I will keep continuing my investigation and I’ll write further blog posts on this.
Cheers,
Tommy

