views:

489

answers:

2

I have a problem in a SharePoint list - some fields appear twice on the Display form, New Item form and on the list settings page. Both fields have the same ID and the same property page (same URL), so hiding one hides the other.
Using SharePoint Manager I can only see one field, but maybe I looked at the wrong places? Has anyone experienced something similar, and how can I solve this issue?

+3  A: 

Yepp, I´ve had those problems working with contenttypes added to lists. When I´ve made updates on the contenttypes somehow the I have sometimes gotten duplicates. When I have looked at them they seem to be the same Ids and Names but the id is actually different.

The solution that I´ve used (works with contenttypes at least) is to compare the fieldlinks on the site contenttypes with the fieldlinks in the actual xml file (feature) that contains the contenttype. If they are not the same number of fieldlinks...take actions to remove the duplicates.

Johan Leino
Hello Johan, thanks! You are absolutely right, btw, this is a content type added to the list by a feature (not mine, though). Where can I find these fieldlinks? Is it done programatically?
Kobi
I mean <FieldRefs> if you know them. Links to the fields used in the contenttype. Since you don´t have access to the actual feature I would recommend Colin´s solution in this case. My solution isn´t really supported, but what is anyway...in SharePoint we need to go around the obstacles anyway we can... :-)
Johan Leino
+3  A: 

It is not wise to update the xml that creates the content type. If you want to add fields later on to the content type, do it through a new feature, see this link.

MSDN Article

Note the following text

Under no circumstances should you update the content type definition file for a content type after you have installed and activated that content type. Windows SharePoint Services does not track changes made to the content type definition file. Therefore, you have no method for pushing down changes made to site content types to the child content types. For information about best practices when making changes to content types that have been installed and activated, see Updating Content Types.

Colin
The problem existed on production, and we had real data. We created new columns and copied the data to them, and deleted the duplicated columns. So, in a way, your solution is what we did - nothing. :-)
Kobi