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

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.

share|improve this question
add comment

2 Answers 2

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()
$Web1.AllProperties["__PublishingFeatureActivated"]="True"
$Web1.Update()

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 :)

share|improve this answer
add comment

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.

share|improve this answer
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.