Has anyone ever seen a Publishing site "lose" the properties relating to the publishing functionality. Properties like PagesListId, PublishingFeatureActivated etc which actually control whether the publishing functionality provided in the site actions menu works e.g. Create a page, edit navigation.

I have come across this for a second time and am struggling to understand how the properties could have been removed/lost/delete from the site. Running commands to add the properties back to the Root SPWeb will fix the issue (have tested and fixed one with this issue before) but I am keen to find out if anyone else has come across the issue before.

BTW I saw a blog entry from someone that fixed this by de/reactivating the Publishing features for the site/web but that never worked for me. I had to find all the missing properties on the root web by comparing it with another publishing site and add them back in via the OM.


Yes, I have experienced the same problem. In my case, the problem resulted in a non-functioning "Site Content and Structure" page. No errors where shown on screen or in the logs. Basically, the only thing that didn't work where the "Reports" (or Views) on the "Site Content and Structure" page in a specific SiteCollection.

At first, I didn't find any information what-so-ever through Google. Found out by trial and error that if I created a new SiteCollection (based on same WebTemplate etc) the Reports are working just fine. After comparing the problematic and new SiteCollection, I noticed that my new SPSite.OpenWeb().AllProperties.Count increased with a couple of items compared to the problematic SiteCollection. After investigating all the properties in this hidden PropertyBag, I found out that the property "_PublishingFeatureActivated" was simply missing! In the newly created SiteCollection, this property was set to “True”. In both SiteCollections the actual PublishingFeature was activated. Manually setting this SPWeb.AllProperties["_PublishingFeatureActivated"] to "True" solved the problem.

Don't forget to perform a SPWeb.Update() after changing the value!

PowerShell script used to solve this problem:

[System.Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") | Out-Null
$Site1 = New-Object Microsoft.SharePoint.SPSite("http://dev.blahblah.net/function")
$Web1= $Site1.OpenWeb()

I don't know what actually caused this SPWeb object to lose some of it's properties. If you ever find out, please post it here :)

| improve this answer | |

I've had this happen if you (or someone else) attempt to update the SPWeb.Properties before the publishing feature has finished configuring the site. (Either via Feature Receiver, or via PowerShell site creation scripts)

The publishing (Web) feature doesn't actually seem to do any configuration, it creates a work item telling a timer job to configure the web. If your feature receiver updates the SPWeb.Properties (or SPWeb.AllProperties) collection, at the wrong time (seems to happen almost 100% of the time for me) all the publishing Properties go missing, and you end up with a broken web, and a manual cleanup.

| improve this answer | |

I have also experienced the same problem, with the Reporting site collection feature which also adds properties to the RootWeb.

Here is my scenario: 1. The root web of a site collection, and its property bag was loaded. 2. The Reporting feature was activated on this site collection. (This adds properties to the property bag, but in a different SPWeb instance) 3. The code made some other changes to the original SPWeb instance, and saved these changes to the database. Thise overwrote the changes added in step #2.

It seems it's fine to edit existing items, or to call Update on web and property bag without having made any changes, but adding an item will cause previously added items to be overwritten.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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