Wednesday, February 25, 2009

Error with Publishing Infrastructure Feature

Recently I came across a scenario where the styling and branding of one of the sites, was not inherited by its site collections. Basically, the structure was like http://website/sites/site1. Also when I tried to explicitly go and change the master page and .css file in the site1 site collection, I could not see master page setting in Site settings.
Then a colleague told me that this is because publishing infrastructure option which is responsible for layout and content structure is not activated. So I tried to activate the feature on the site collection.
Well not so easy, I started getting the following error:
"Creation of folders is not allowed for this template"
I googled a lot, but could not find a solution, since most of the people get an error on activating this feature, but it is generally "Access Denied" one. So atlast not being able to come up with any solution, I tried to activate the feature through stsadm command:
stsadm -o activatefeature -PublishingResources -url http://website
But I faced error with this too, cannot create content kind of error. So the next option that I tried is use -force with the stsadm command.
And yes operation successful message was received. But still I cannot see the feature as activated in the site collection features list. However, the masterpage setting, and other folders did get created.
Now lets come to why possibly this error would be coming. I could come to the conclusion that this was happening because my application had been upgraded from SPS2003 to MOSS, and apparently migration did not happen correctly with this site collection.
Also if the -force option does not help, then the next idea is to reset the site definition. Through this you will lose your styling or layout changes which you might have done explicitly for this site, but atleast you can try out. Make sure you take appropriate backups before applying something drastic.
Happy Sharepointing.