Thursday, September 23, 2010

Missing Icon Images in SharePoint 2010 Lists

After installing the 64-bit Adobe PDF iFilter on Windows Server 2008, an odd thing happened.  Some of the document icons for items in SharePoint lists disappeared.  The icons were not being referenced in the HTML.  The URL would appear as:

http://site_name/_layouts/images/

with no actual image specified.  Typically there would be a generic document icon, such as the image file icgen.gif.  Instead there was just a horrifically ugly broken image link.

I had followed the directions for installing the Adobe PDF iFilter to the letter. 

  • I added all the appropriate registry keys.
  • I copied the PDF icon image to the appropriate folder in the SharePoint hive at \14\template\images
  • I modified the docicon.xml file to include a mapping key value for the PDF image in the 14 hive folder at \14\template\xml
  • I restarted the SharePoint Foundation Search V4 service and the SharePoint Server Search 14 service. 

The searching and indexing of PDF files worked correctly, and the PDF files in my document libraries had the proper PDF icon displayed in List view.  But the icons for generic list items failed to display.

Some advice online suggested checking the permissions of the application pool associated with the SharePoint site.  I did this, but the permissions on both the app pool and the site itself were fine (and they had worked previously).

As a last resort, I changed the location of the mapping key in the docicon.xml file located at \14\template\xml

I moved the reference for:

<Mapping Key="pdf" Value="pdf.gif"/>

to the bottom of the <ByExtension> section of the XML document.   After restarting the IIS service, the PDF image icon continued to display correctly, and the icgen.gif image rendered properly as well in all of my SharePoint lists. 

In honesty I can’t explain why moving the Mapping Key to the bottom of the <ByExtension> section of the docicon.xml file worked, but if you find yourself in a similar predicament, it may help.