Re-provisioning the Publishing Feature in MOSS 2007
The Problem
NOTE: Note that this article does not apply to you if do not have the following features activated:
- Office SharePoint Server Publishing (Site Feature)
- Office SharePoint Server Publishing Infrastructure (Site Collection Feature)
If you are experiencing one or more of the following symptoms on your Office SharePoint Server 2007 sites, the “publishing” feature of your site is probably in a bad state:
- The “Create Page” option is missing from the “Site Actions” menu
- The “Modify Navigation” option is grayed out in the “Site Actions” menu (Site Actions –> Site Settings –> Modify Navigation)
- You get the “File Not Found” (Exception from HRESULT: 0x80070002) error when performing different operations (such as changing the master page or welcome page).
- You get one of the following errors when you attempt to Deactivate the site feature “Office SharePoint Server Publishing”:
- Value does not fall within the expected range
- The given key was not present in the dictionary
The Cause
In most cases, we have seen this to be an issue where a site was created using a team site or a blank site template, and the publishing features were activated on the site afterwards. We have also seen this issue on custom site templates that are using the publishing features. Lastly, this issue can also occur on sites that were upgraded from SPS 2003 to MOSS 2007.
The Solution
Please follow the steps mentioned here, and that should allow us to re-provision the publishing feature. Although these steps should not cause any data loss, I highly encourage you to test this first before applying this in a production environment:
STEP 1: De-activate the site feature “Office SharePoint Server Publishing”
Following are the steps that need to be performed:
- Browse to your site collection
- From the “Site Actions” menu, click on “Site Settings –> Modify All Site Settings”
- Under “Site Administration”, click on “Site features”
- Click on “Deactivate” next to “Office SharePoint Server Publishing”. If you get an error when deactivating the feature, please note the error description.
- Go back to the site features page. You will notice that the feature got deactivated even though you got the error. Go ahead and activate the feature again. Feature activation should not throw any errors.
- If you got the error “Value does not fall within the expected range” in step 1-4, go to step 2
- If you did not get any error, or got the error “The given key was not present in the dictionary” in step 1-4, go to step 3
STEP 2: Create the missing libraries
The error "Value does not fall within the expected range" when you deactivate the "Office SharePoint Server Publishing" feature indicates that there are one or more document libraries that are required by the publishing feature, but are not present in your site. To find out all the document libraries in your site, go to Site Actions --> View All Site Content. Following are the document libraries that you should see. If a document library from the list below does not exist in your site, please create the library with the exact same name and go back to step 1. Here is the list:
- Documents
- Images
- Pages
- Site Collection Documents
- Site Collection Images
- Style Library
After creating the missing libraries, please go back to step 1.
STEP 3: Re-provision the Publishing Infrastructure Feature
The error "The given key was not present in the dictionary" when you deactivate the site feature "Office SharePoint Server Publishing" indicates some of the components of the "Office SharePoint Server Publishing Infrastructure" site collection feature are not present in the site collection. Note that unlike the "Office SharePoint Server Publishing" feature which is a site feature, the "Office SharePoint Server Publishing Infrastructure" is a site collection feature. Please complete the following steps to address this issue:
- Browse to the top level site in your site collection
- From the “Site Actions” menu, click on “Site Settings –> Modify All Site Settings”
- Under "Site Collection Administration", click on "Site Collection Features"
- Deactivate the feature "Office SharePoint Server Publishing Infrastructure"
- Activate back the feature "Office SharePoint Server Publishing Infrastructure"
- Go back to the Site Settings page, and click on "Site Features" under "Site Administration
- Deactivate the feature "Office SharePoint Server Publishing" (Note: there should be no errors this time)
- Activate back the feature "Office SharePoint Server Publishing"
At this point, the publishing feature should have been provisioned properly. You should see the "Create Page" and "Modify Navigation" options in "Site Actions" menu, and the File Not Found error should also go away.
Happy SharePointing!
TehnoonR
Comments
Anonymous
February 01, 2011
Thanks for the post, certainly pointed me in the right direction. One thing to update/note, the Images library in the publish feature is called Images, but is actually PublishingImages behind the scenes. Caused a bit of confusion.Anonymous
February 07, 2011
Thanks for the inputs Bryce!Anonymous
February 21, 2011
I've been experiencing this problem on a couple of our site collections but not others. I've been through all the steps in this article - certainly the best I've seen on the subject but to no avail. The sites I am trying to update are the root sites of a collection, would that make any difference?Anonymous
February 22, 2011
Hi Liam, Are you able to provision the publishing and publishing infrastructure features without getting any errors? The fact that you are working with root sites should not make any difference to the steps. If you are able to re-provision the features correctly, what problems are you experiencing?Anonymous
February 22, 2011
Hi and thanks for getting back to me. I get an Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)) when trying to provision the features via Site Features but am able to activate the feature via Central Admin. I then get the 'value does not fall within the expected range' error when deactivating even after following all step 2, I'm stuck in a Step1-Step2 infinite loop :) The only symptom I have is the greying out of the Modify Navigation button. Thanks LiamAnonymous
February 23, 2011
Hi Liam, We should focus on "value does not faill within the expected range". Seems like we may still be missing some required libraries. Please reproduce the error, note the timestamp of the error and look at the SharePoint ULS logs for the error. In there, you should see why we're throwing the value does not fall" error. It is typically due to a library not being available and we should see the name of that library in the logs.Anonymous
February 23, 2011
Thanks, I've figured out which library it was now. I'd created the PublishingImages library but mis-spelled publishing. Many thanksAnonymous
July 26, 2011
The comment has been removed