Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
The site template is a template created from the user interface on SP 2007? It contained any feature that added such content type? –  SPArchaeologist Nov 20 '12 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 '12 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. –  SPArchaeologist Nov 26 '12 at 8:50
    
Yes that's what I'm experiencing. So how did you resolve it? –  Sepaka Nov 26 '12 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). –  SPArchaeologist Nov 26 '12 at 8:55
add comment

1 Answer 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.

share|improve this answer
    
Thank you SPArchaeologist. This really sounds promising. –  Sepaka Nov 27 '12 at 12:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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