Applies To: SharePoint 2010
We ran into an interesting problem the other day where a user called and said that everytime they clicked the Add New Document link they got a giant error message. I went to the site and was able to confirm that it was indeed blowing up.
This was only happening when the document library was being exposed through a web part on another page. Going directly to the library and clicking New Document or Upload Document in the ribbon worked just fine. The problem was obviously with the web part toolbar, which in this case was set to Summary Toolbar.
It appears this is something left over from our upgrade from SharePoint 2007 to SharePoint 2010. I would’ve thought the Visual Upgrade would have fixed this and it’s amazing no one noticed for well over a year! It seems that Microsoft changed not only the look of the link (switching the icon from a little square to a green plus and removing the word new) the underlying address also changed.
Broken Old Style Link
Correct Style Link
Taking a look at where these links were pointed, I could see that the old style link was pointed at listform.aspx:
While the new style link was pointed at Upload.aspx:
Fixing this is pretty easy. Just edit the web part and change the Toolbar Type to No Toolbar and click Apply:
Then immediately switch the Toolbar Type back to Summary Toolbar and press OK:
Interestingly, other web parts sometimes show the old style link too (links, announcements, etc.) but since these all seem to still use the listform.aspx they continue to work. However, you can use the above technique to get them to match visually as well (green plus icon).
One thought on “Broken Add New Document Links”