On a recent client project, we implemented a solution that heavily used article pages / page layouts from the SharePoint 2010 Pages library. Most of them had images. While working through use cases with these articles, I came across some strange behavior that someone else had found but not documented (to my knowledge). As a result, I wanted to blog about the topic to make it easier for others to find.

The Problem

This particular problem comes in SharePoint 2010 when using a Picture library with images in a subfolder and trying to insert an image by clicking on the subfolder. Once you click, SharePoint generates this error:  “The object specified does not belong to a list.” 

SharePoint 2010 Error






In the ULS logs, it gives basically the same error: System.InvalidOperationException: The object specified does not belong to a list.” 

I was able to replicate this problem, so I believe this is a true bug in SharePoint. I was able to replicate this when inserting images to a publishing article page, and just a wiki page. I was seeing this behavior only apply to a picture library, and only when using subfolders, and only when clicking on the folder in the right pane. The steps to reproduce and the person who provided the fix are in this TechNet forum post, so credit goes to them. 

The Solution

It’s a quick fix, as we just need to modify the column in a view and switch a column. To resolve the error, perform the following: 
  1. Open your picture library, and edit the All Pictures view, clicking Modify view.  
        Modify this View SharePoint 2010




2.  Uncheck the column for “Name (linked to display items)”, and check the box called “Name (linked to document with edit menu)”. 

3. Try to click on the subfolder in the Insert an Asset window from the article page, it will load the view instead of throwing the error.

Logos in SharePoint 2010





Testing the Problem in SharePoint 2013 

I was curious to see if this still existed in SharePoint 2013, and it does not. You can click on the subfolder from the Select an Asset screen just fine, without an error:

Select an Asset SharePoint 2010






To find out more about our services and solutions, please fill out our Contact Us form.