CharlZ's Blog

"We need to talk about your TPS reports."

About the author

SharePoint / .NET Developer / Source Code Sanitation Worker in Chicago area.

Share This!

Month List

Page List

    Bug in WSS 3.0 Picture Library after upgrade to SharePoint 2010

    Symptoms

    After upgrading content from WSS 3.0 to SharePoint Foundation 2010, we discovered the following behavior when clicking on an image inside of a picture library:
     
    This behavior was only observed on picture libraries that existed prior to the upgrade. Any picture libraries that we created after the upgrade process did not suffer from this issue.  When I opened the AllItems.aspx pages in for each list in SharePoint Designer 2010, I could see that each page used different web parts to display the list of items. The upgraded content (originally in WSS 3.0) used a ListViewWebPart object to display the list of items and the newly created list used an XsltListViewWebPart.
    Further investigation of the upgraded picture library revealed that the error message was being generated due to an invalid URL to list item page that was being constructed by SharePoint. SharePoint was generating a URL that looked like the following:
    http://<Server>/<Site>/_Layouts/listform.aspx?PageType=4&ListId={GUID}?ID=XX&Source=<URL of original source page>&RootFolder=<Folder where image resides>
    Because of the duplicated question marks in the query string portion of the URL, the page fails to load. When I manually modified the URL to contain an ampersand instead of a second question mark, the list item page was displayed.

    Resolution

    The resolution to this issue turns out to be fairly simple, all though potentially time consuming if your affected site has many picture libraries. The steps are detailed below: 
    1. Open the AllItems.aspx page of the affected list
    2. In the top left hand corner of the page, click Site Actions / Edit Page
    3. Edit the properties of the list view web part and press OK on the tool part. This step appears to fix whatever values are corrupted in the list view web part’s properties.
    4. Reload the page and it should work correctly.
    5. Repeat this for each view in the list.
    These steps appear to work for the All Items view, but may not correct any of the standard list views.

    Further Analysis

    After comparing the ListViewXml data from the page prior to the fix and page after the fix, we can see that SharePoint has modified some of the underlying JavaScript to correct the URL it constructs to the list item details page.

    Original Page

    <![CDATA[
    <script>
    fImglibDefautlView = true;

    urlCmdForDisplay = ctx.displayFormUrl + "?RootFolder=]]>

    Corrected Page

    <![CDATA[
    <Script>
    fImglibDefautlView = true;
    strSeperator = "&";
    if (ctx.displayFormUrl.indexOf("?") == -1)
                strSeperator = "?";
    urlCmdForDisplay = ctx.displayFormUrl + strSeperator + "RootFolder=]]>

    Programmatic Fix

    I have put together a console application that will process all of the lists on your SharePoint farm and correct the invalid markup in the views.  Download the Visual Studio 2010 project below:

    CorrectPictureViews.zip (59.12 kb)


    Permalink | Comments (4) | Post RSSRSS comment feed

    NES CHR Editor - BETA 1

    NES CHR Editor

    I have completed an initial build of an editor for NES CHR graphics.  The application is built in C# and requires the Microsoft.NET 2.0 Framework.  This version is not completely finished and there are probably a few bugs.  Some of the planned additions are listed below.

    • Add support for direct editing of .NES files
    • Allow for adding and removing of CHR 4k pages
    • Loading and saving of selected color palette
    • Toolbox window to allow for tiling of selected sprites

    Since this version does not yet allow for direct editing of .NES files, I have included a small utility called SplitNES.  This applicaiton will create .HDR/.CHR/.PRG files from a .NES file.

     

    Here is a screen shot of CHR Editor with the graphics from Super Mario Bros.

     

    Download here:  CHREditor_0.800_BETA_.zip (27.22 kb)


    Permalink | Comments (0) | Post RSSRSS comment feed