Generic Errors with Lists and Manage Content and Structure Tool

image

An unexpected error has occurred. Yep. Very helpful! Recently, when attempting to use the Manage Content and Structure tool (found under Site Actions > Manage Content and Structure), I received the above error. Looking into the ULS logs, all I was able to get ahold of was a System.NullReferenceException. Again, not really handy, or useful, at all.

I was able to determine that it had to probably be due to a list… turns out, we had deactivated and retracted several features from our farm recently, several of which relied on custom lists to store the data. If I go to View All Site Content (Site Actions > View All Site Content), and click on one of these lists, I get a similar error to the above.

Luckily, one of the times when attempting to launch the Manage Content and Structure Tool, I was able to get this error in the ULS logs.

Failed to determine the setup path of the list schema for feature {553B9E4F-C7EA-4442-845F-94390C1EAE44}, list template 10000.

So, basically, we need to remove these lists. We cannot get into the “Delete this List” option within the List management screen – otherwise you’ll get an error similar to the above. I also attempted to use SharePoint Manager 2010, which also gave an error. I just couldn’t delete the list using traditional means…

You have two options here…

  1. Write some code to delete the list (C#, PowerShell… whatever you desire)
  2. Use Gary LaPointe’s STSADM extensions and PowerShell scripts.
    1. Remove-SPList PowerShell Command
    2. gl-deletelist STSADM command

Either of those should do the trick! Now, to get the List URL is simple, the lists should still appear under View All Site Content, just right-click and copy the shortcut to the list view, for example: http://sharepointsite.com/Lists/SomeCustomList/AllItems.aspx

Use that when calling those commands with the URL parameter, and you’re good to go.

LotD: Using PowerShell to Approve List Items

The Link of the Day (LotD) goes out to Eric Shupps for this quick PowerShell snippet http://www.binarywave.com/blogs/eshupps/Lists/Posts/Post.aspx?List=89cbe813%2D99f7%2D4257%2Da23a%2D5fefc377336b&ID=241&Web=c7893495%2Dbe3b%2D4d73%2D9875%2D28b039760651. This PowerShell code will loop through a list of your choice and approve list items. This is a huge timesaver for me right at the moment. Thank you Shupps!

I do have some slight changes to the code. There is no need to open the site collection object (line 1), we can just use Get-SPWeb to open the web we need, and, also disposing of the web object at the end, so we don’t leave it sitting around eating up memory on the server.

Normally I do not create posts like this, but, I think I had something to add to it, and, I know exactly where to find it later on, as I am sure I will need it.

   1: $web = Get-SPWeb "http://site"

   2: $list = $web.Lists["Posts"]

   3: $items = $list.Items 

   4:  

   5: foreach ($item in $items)

   6: {

   7:     $item["_ModerationStatus"] = 0

   8:     $item.Update()

   9: } 

  10: $web.Dispose()

And before you use this – please read this: http://gvaro.wordpress.com/2011/03/26/test-out-your-powershell-scripts-first-in-a-non-production-environment-first/ (and also read the comment by Anders Rask)

List View Web Part Toolbar Types in SharePoint 2010

When imageadding a List View Web Part to your pages in SharePoint 2007, you had 3 options:

  • Full Toolbar
    • Gave you the library controls on a toolbar above your headers and list items, but no “Add new document” or “Add new list item” link below your data, because it was available in the toolbar above.
      image
  • Summary Toolbar
    • Gave you the “Add new document” link below your data
      image
  • No Toolbar
    • Nothing!

In SharePoint 2010, things are slightly different. Let’s take a look at our options, as well as how they are rendered.

  • Full Toolbar
    • Just appears to give us the “Add Document” link. No toolbar being shown. Odd.
      image
  • Summary Toolbar
    • The exact same thing as the “Full Toolbar”. Odd, again.
      image
  • No Toolbar
    • Works as advertised.
      image
  • Show Toolbar
    • The new option on the block… This option now acts like the old “Full Toolbar” used to.
      image

My big question here is, why leave the “Full Toolbar” option, if it is now exactly the same as the Summary Toolbar? My guess would be for backwards compatibility. Also, if you hadn’t noticed – the ribbon in 2010 also takes the place of some of these options. Go ahead and click into your webpart somewhere, you’ll notice you get the contextual ribbon options for the list and list items, negating the need for the “Full Toolbar” option.

image

Hope this helps map out what these options are. I had not paid much attention to these as of yet, until it was brought up by a client recently.

Follow

Get every new post delivered to your Inbox.

Join 3,297 other followers

%d bloggers like this: