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

Does anyone have any idea on how I can fix the navigation? I tried to go into Site Actions-->Site Settings --> Navigation but that page is not loading.

I already tried the Enable/Disable publishing feature (using powershel), Designer, but so far I was not able to make it work.

enter image description here

I will reward anyone that helps me find the answer with a bounty and 50 points as soon as I can get the bounty started.

Thank You for reading

****MORE INFO******* This is a SharePoint 2010

Ran this PowerShell script and was able to get to the navigation page under /HR I don't mind to rebuild the top navigation if needed:

# get the site collection
$spSite = Get-SPSite -Identity "http://intranet"
# loop through all the webs in the site collection
foreach ($spWeb in $spSite.AllWebs)
{
    # check if root web as this one doesn't obviously inherit
    if (!$spWeb.IsRootWeb)
{
    if($spWeb.URL -eq "http://intranet/HR"){

        # grab a Navigation object
        $spWebNavigation = $spWeb.Navigation
        # change to true
        $spWebNavigation.UseShared = $false
        $spWeb.URL

     }
}
    # cleanup
    $spWeb.Dispose()
}
# cleanup
$spSite.Dispose()

share|improve this question
    
This is OOTB, and started to happen after I added another link in the navigation. Nothing that could have caused this problem. –  MicroSumol Feb 8 '13 at 0:15
    
The page is loading as you can see part of the picture. But it's taking forever. –  MicroSumol Feb 8 '13 at 0:19
    
SharePoint 2010 –  MicroSumol Feb 8 '13 at 0:23
    
rjcup3 - I just deleted the page where the link was pointing to and everything started working again. Suggest that as an answer and I will reward you. –  MicroSumol Feb 8 '13 at 0:36

2 Answers 2

up vote 2 down vote accepted

This error seems to be caused by a bug in the August 2012 CU (see An Unexpected Error..., also SharePoint 2010 Naviagtion error...), which causes duplicate nodes to be created in the navigation tree.

You can use the following PowerShell script to fix this if you supply the path to the page affected and the full URL of the node you added when it broke:

$snapin = Get-PSSnapIn | where-object { $_.Name -eq 'Microsoft.SharePoint.PowerShell' }
if ($snapin -eq $null)
{
  Add-PSSnapin Microsoft.SharePoint.PowerShell
  Write-Host "SharePoint Snapin Loaded"
}

$web = Get-SPWeb http://server:port/path/to/web
$pubWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$navNodes = $pubWeb.Navigation.CurrentNavigationNodes

$brokenNodes = $navNodes | where { $_.Url -eq "http://server:port/full/url/to/broken/link" }

for($i = $brokenNodes.Count - 1; $i -ge 0; $i--)
{
  Write-Host "Deleting " $brokenNodes[$i].Title " " $brokenNodes[$i].ID
  $brokenNodes[$i].Delete()
}

$web.Dispose()

Hope this helps.

Edit

A note on the code in your edit: Why don't you just get the SPWeb object that you want to work with directly?

$spWeb = Get-SPWeb -Identity "http://intranet/HR"
$spWebNavigation = $spWeb.Navigation
$spWebNavigation.UseShared = $false
$spWeb.URL

$spWeb.Dispose()
share|improve this answer

I had the same symptoms but a different cause. It turns out you can deploy an Elements.xml file that re-defines an existing, OOB site column. Somebody created a element using the GUID {9da97a8a-1da5-4a77-98d3-4bc10456e700} which is the ID for the built-in field with the internal name Comments, used in the Publishing content types for check-in comments. In our case, that field got the new internal name "Details" (and was published out through content type publishing!). Every new site collection had a mis-named Comments field and so had a broken top nav bar (turn logging up to verbose and you'll see that SP queries the Pages library and looks for the Comments field). This also prevented me from restoring a (publishing-enabled) site collection that had been exported using stsadm -o export because of a 'duplicate field name' on that GUID in the target site collection. It's like Sharepoint no longer sees the column as a built-in field.

Beware! You have to re-create the site collections to fix the re-named built-in field.

share|improve this answer

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.