1

I have just upgraded customer environment to SharePoint 2010. I have been having minor issues with content types of which some I managed to resolve except the following one:

We have a SharePoint 2010 site templates that we use to create sites, but now we are experiencing an issue where by the site fails to get created due to "a duplicate content type '' has been found" error message. I tried to rename it using SharePoint Manager tool but I still get the same error. Deleting it is not an option because there's a couple of sites that are using it.

Anyone who might have came across something like this I will really appreciate your help.

5
  • The site template is a template created from the user interface on SP 2007? It contained any feature that added such content type?
    – SPArcheon
    Nov 20, 2012 at 9:40
  • Yes you are right SPArchaeologist. It created a feature but then again how do I get to resolve such, becuase when I deactivate a feature I get a different error message.
    – Sepaka
    Nov 26, 2012 at 8:12
  • Ok, I don't know if it may be your case, but in the past I experienced a bug with site templates: the pratical effect was that features where "performed two times". The template recreated the content types/document lib/whatever, then activated the feature -> which would then explode because the element was already there. You may be experiencing the same.
    – SPArcheon
    Nov 26, 2012 at 8:50
  • Yes that's what I'm experiencing. So how did you resolve it?
    – Sepaka
    Nov 26, 2012 at 8:53
  • Give me a sec - I will try to put that in an answer since it may be usefull to you (and others).
    – SPArcheon
    Nov 26, 2012 at 8:55

1 Answer 1

1

Don't know if your problem is actually caused by the same behaviour I was experiencing in the past, but since no other answers have been posted, I am writting this anyway.

Basically, in my case the problem was that the template (uploaded to the solution gallery in sharepoint) was somehow activating the same feature multiple times. I can only suppose that this issue was caused by a bug in the logic that handles the creation of a site from a template, but it could have also be caused by a (baddly written) stappler that I found on the site.

That said, the first step would be confirming that you ARE actually experiencing the same problem. I would try to edit the feature code to add some sort of log so that you can determine if the feature activation is really performed multiple times. As an alternative, you can also try to obtain/create a version of the template on which the problematic feature has been deactivated: this could help to poinpoint a similar problem. Let me explain: if you find that the content type is created even when the feature is deactive, it would mean that the SharePoint created the ct as a part of the template and not because your feature created it. This would also mean that when the feature get activated it could throw an error because the template is indeed already present.

If your test show that you are actually experiencing a problem related to the behaviour I have described, I fear that the only solution is to modify the template, the feature or both. You want to obtain a situation where you are sure that the feature only get activated one time, or modify the features so that they won't raise an error if a element (ie: your content type) is already present when they get activated. In my case I was lucky: I was creating the site in some codebehind logic, so I was able to deactivate the feature from the template and activate it programmatically only when the creation was completed. I don't know if you can do the same, but it could be a last resort solution before nuking the template from orbit and switching to a definition...

Hope that this can be usefull to you. Also, anyone that has a better understanding of the problem feel free to leave a notice/edit this answer/post another answer.

1
  • Thank you SPArchaeologist. This really sounds promising.
    – Sepaka
    Nov 27, 2012 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.