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:

  1. Office SharePoint Server Publishing (Site Feature)
  2. 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:

  1. The “Create Page” option is missing from the “Site Actions” menu
  2. The “Modify Navigation” option is grayed out in the “Site Actions” menu (Site Actions –> Site Settings –> Modify Navigation)
  3. You get the “File Not Found” (Exception from HRESULT: 0x80070002) error when performing different operations (such as changing the master page or welcome page).
  4. 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:

  1. Browse to your site collection
  2. From the “Site Actions” menu, click on “Site Settings –> Modify All Site Settings”
  3. Under “Site Administration”, click on “Site features”
  4. Click on “Deactivate” next to “Office SharePoint Server Publishing”. If you get an error when deactivating the feature, please note the error description.
  5. 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.
  6. If you got the error “Value does not fall within the expected range” in step 1-4, go to step 2
  7. 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:

  1. Documents
  2. Images
  3. Pages
  4. Site Collection Documents
  5. Site Collection Images
  6. 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:

  1. Browse to the top level site in your site collection
  2. From the “Site Actions” menu, click on “Site Settings –> Modify All Site Settings”
  3. Under "Site Collection Administration", click on "Site Collection Features"
  4. Deactivate the feature "Office SharePoint Server Publishing Infrastructure"
  5. Activate back the feature "Office SharePoint Server Publishing Infrastructure"
  6. Go back to the Site Settings page, and click on "Site Features" under "Site Administration
  7. Deactivate the feature "Office SharePoint Server Publishing" (Note: there should be no errors this time)
  8. 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