Site columns missing (probably deleted)

Problem

Site columns missing from site collection columns gallery and from every content type that was using them. Possibly deleted by site collection administrator.

Case

I had a site collection scoped feature which deploys site columns and content types. There was a document library with multiple content types that inherit from the site content type deployed with that feature. For some reason some of the columns were missing from the site content type. As a result all the children content types were missing those columns and, of course because of that they were not available in the document library. It was surprising that they were not event in the site columns gallery. Probably somebody has deleted them from the site columns gallery.

Investigation

I returned the site collection columns by deactivating and reactivate the site collection feature that has originally deployed those columns. This action returned the columns back and they also showed back in the content type without explicitly re-adding them.
Now the problem was that I was not able to push the changes down to the content types that inherit from this site content type. I tried with UI and also with code by calling SPContentType.Update(true, true) but without success. Finally I found a workaround by adding a new content type inheriting from this content type. After creating the new content type all the missing fields showed back in all the content types and as a result in the document library.

Solution

  1. Deactivate and reactivate the site collection feature that has originally deployed the missing site columns.
  2. Add new content type that inherits from the site content type that contains the missing columns to the document library temporarily.
  3. Delete the newly added content type.
Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: