Google Sitemap Bug for Forums

rated by 0 users
This post has 0 Replies | 0 Followers

Not Ranked
Posts 24
Points 315
Carsinigin Posted: Fri, Apr 20 2007 3:23 PM

I was looking at the xml generated by googlesitemap.ashx and going to some of the url's it produces and notices that most of the url's it provides give me an error message and some of the older ones give me a page where the posts do not match the page title.

Example URL from my test system:

 http://localhost:15157/forums/p/13503/13503.aspx#13503

This produces an this error:

Server Error in '/' Application.

An entry with the same key already exists.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: An entry with the same key already exists.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: An entry with the same key already exists.]
System.Collections.Specialized.ListDictionary.Add(Object key, Object value) +264
System.Collections.Specialized.HybridDictionary.Add(Object key, Object value) +227
CommunityServer.Discussions.Components.Threads.GetThread(Int32 threadID) +379
CommunityServer.Discussions.Controls.CSForumThemePage.GetCurrentThread(Boolean allowAccessToOtherProperties) +127
CommunityServer.Discussions.Controls.CSForumThemePage.get_CurrentThread() +81
CommunityServer.Discussions.Controls.CSForumThemePage.OnInit(EventArgs e) +418
System.Web.UI.Control.InitRecursive(Control namingContainer) +459
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1748


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
 

 
After finding that post manually I the correct URL is:


http://localhost:15157/forums/p/1651/13503.aspx#13503

 

So googlesitemap.ashx is replacing the ThreadID with the PostID when generating the URLs. 

 
Here's the Fix

In googlesitemap.ashx


private List<GoogleSiteMapItem> BuildURLList(Forum f)  (Line 210)


Change (This is Line 221)

string loc = ForumUrls.Instance().PostPermaLink(p.PostID, p.PostID);

to

string loc = ForumUrls.Instance().PostPermaLink(p.Thread, p.PostID);

 

The Sitemaps for blogs look right.  I don't have File Folders or public Galleries so I haven't check those sitemaps.
 

Page 1 of 1 (1 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com