This is a pretty weird error. I was doing content roll-up of Announcements lists, to give a unified news channel for our intranet. Naturally, I decided to do this using the Content Query Web Part. I added one, and selected that I wanted to query for the contents of Announcements lists. As I like RSS feeds, I enabled one, and I added it to my favorite feed-reader.
It worked – but the links to the announcements themselves didn’t work. The short summary is that is that it appears RSS feeds from Content Query Web Parts don’t work when you query for certain types of list.
What I realised was that there was no server in the URL, so my feed reader’s link to the item was going to a URL starting:
I’m now tempted to register the _layouts domain ;p
Anyway, checking in the RSS source showed links to incomplete URLs:
Hmm. So how to fix it? I did some Googling and found references to similar URLs, and the solution seemed to be to modify the ContentQueryMain.xslt file (found in the Style Library > XSL Style Sheets). I couldn’t see why this should make a difference – it’s not to do with the RSS feed – but I thought I’d try just incase I’d misunderstood.
I hadn’t. It didn’t work.
I then wondered if the RSS feed worked for a new Content Query Web Part that had just been added to a page. I added one, and enabled the RSS feed. It did work – the URLs in the links contained the server.
I exported both web parts as XML and differenced them. One thing I noticed was that the UseCopyUtil setting was false in the working web part, and true in the one that wasn’t. I changed this to true, imported the web part, and now the URLs had a server at the start. They weren’t valid URLs still, so I swapped back.
Next, I wondered what would happen if I took the web part with the working RSS feed, and slowly changed it over to the query I wanted to run. Presumably, at some point it would break.
It did. When I selected that I wanted to query for Items in an Announcement list rather than a Pages library. I changed my query back to Pages – and the RSS feed worked. I tried changing to query for Document libraries – and the RSS feed worked. Then I tried changing the query to get items from Discussions lists – and the RSS feed failed again.
I then took a look at the page being used for the RSS feed (feed.aspx). All it was really doing was inheriting from the Microsoft.SharePoint.Publishing.Internal.CodeBehind.FeedPage page class. I broke out Reflector, and tried following what was going on inside, but to be honest, it was too complicated, and I couldn’t be bothered.
Either way, it looks like the Content Query Web Part’s RSS feed doesn’t work if you’re querying for Announcement lists.