Category Archives: SharePoint Bugs

Quick Fix: “The content type name ‘$Resources:ReportServerResources … cannot contain … special characters”

I’ve been spending some time cleaning up a SharePoint 2010 site and one of the cleanup issues relates to a corrupt / incorrectly installed SQL Server Report Services issue.  The issue arose when one of my colleagues tried to save a site as a template and then create create a new site based on that template.  The save operation worked fine, but when she tried to create the new site, SharePoint displayed the following error message:

Error

The content type name ‘$Resources:ReportServerResources,DataSourceContentTypeName;’ cannot contain: \ / : * ? “ # % < > { } | ~ & , two consecutive periods (..), or special characters such as a tab.

Here’s a screen cap:

 

image

I had a look at the content types in the site and found this:

image

Those content types are clearly unhealthy.

This issue seems to come up a lot on the Internets and there doesn’t seem to be a single consensus on how to solve it.  I found a handy table that mapped the bad content type names to good content type names here: http://social.technet.microsoft.com/Forums/en-ZA/sharepoint2010programming/thread/cb03e866-8184-4943-acfe-cafffa1b8b7a.  I manually updated them thusly:

image

(BrightStarr in the name is obviously optional, but it can’t hurt Smile )

This allowed me to create a new template and didn’t break anything on the other sites, including some PerformancePoint Server stuff that a completely different group of people were working on.  I was then able to create a new site on the template.  Success!

I am not sure this is a 100% solution, but it got me and everyone involved past this annoying error.  If I find anything new, I’ll post an update.  My nervousness stems from the fact that these names shouldn’t be wrong in the first place and by fixing the display name, I am not touching the internal name. 

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

SP 2010 CQWP, Document Libraries and Anonymous Users

Important update:  Waldek Mastykarz has posted a workaround here: http://blog.mastykarz.nl/inconvenient-sharepoint-2010-content-query-web-part-anonymous-access/.
</end update>

This week, my team and I were upgrading a customer’s public internet site from MOSS to SP 2010.  The MOSS site uses the CQWP in several places.

We went through a very detailed procedure to ensure accuracy, quality and all that good stuff.  Despite that, we ran into a problem in the 11th hour that we didn’t expect or uncover until very late.  Specifically, our CQWP wouldn’t render for anonymous users.  It rendered find for the authors (who were logged in), but it wouldn’t show the content for anonymous users.

We did a lot of research and these are the parameters and actions we took to isolate the behavior:

  • CQWP would render fine when it was pulling content from a custom list.
  • CQWP would render content from the /Pages library.
  • It would not render content from /SiteCollectionImages
  • We created a new document library and uploaded a few docs to it.  We did not add any content types to the library – this was a simple out of the box doc lib with no customization.  Existing CQWP could not read from it.
  • We created a new page and added a CQWP to it using all default values.  it would not render for anonymous.
  • We (somewhat hastily) set up a new SP 2010 environment, straight out of the box again and replicated this behavior.

Bottom line, it appears that CQWP in SP2010 can’t render content for anonymous users when the data source is a document library.  Can this be true?

This is the error that we saw in the logs:

Web Part title: Content Query Web Part 653d91fb-2f83-4e6a-83af-1f39e8939f0a
07/30/2010 12:03:56.90  w3wp.exe (0x0F30)                        0x1540 SharePoint Foundation          Web Parts                      89a1 High     Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.SetDocumentIconUrlAndOnClickString(SPWeb web, DataRow row, String strDefaultItemOpen, Boolean fSetDocIcon, Boolean fSetOnClick, String fileRefColumnRef, String progIdColumnRef, String fsobjTypeColumnRef, String permMaskColumnRef)     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.PreProcessForDocumentIconAndOnClickAttribute()     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.AddContentQueryData()     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.GetXPathNavigator(String viewPath)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart…. 653d91fb-2f83-4e6a-83af-1f39e8939f0a

It just seems kind of impossible that CQWP wouldn’t work for anonymous users.  If you know any more about this, please post a comment.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin