CS: BUG: Partial Fix: The erroneous use of BlogPost properties
While looking into some mirrored blog issues, I noticed that the blog comment flags were not functioning properly. I have currently discovered that the EnableCommentsDefault property has been erroneously used in several places where the EnableCommentsOverride property should have been used. In fact, several of the Default properties appear to have been erroneously used where Override properties should have been used.
It looks like the RssComments and others may also be affected, but I am not familiar with those sections and how they are supposed to work, so I didn't make any changes in those areas. Here are the changes I made:
Location #1
On or around line 658 of CommunityServerBlogs(20)\Components\Weblog.cs either comment out or remove the following 2 lines:
if(!EnableCommentsDefault)
return false;
Location #2
On or around line 233 of CommunityServerBlogs(20)\Controls\AggregateBlogControls\AggregateList.cs change:
Comments.Text = String.Format(ResourceManager.GetString("Weblog_EntryList_Comments"), (!post.Weblog.EnableCommentsOverride || !post.Weblog.EnableCommentsDefault || post.IsLocked) ? "0" : post.Replies.ToString());
to:
Comments.Text = String.Format(ResourceManager.GetString("Weblog_EntryList_Comments"), (!post.Weblog.EnableCommentsOverride || post.IsLocked) ? "0" : post.Replies.ToString());
Location #3
On or around line 247 of CommunityServerBlogs(20)\Controls\AggregateBlogControls\AggregateList.cs change:
CommentCount.Text = (!post.Weblog.EnableCommentsOverride || !post.Weblog.EnableCommentsDefault || post.IsLocked) ? "0" : post.Replies.ToString();
to:
CommentCount.Text = (!post.Weblog.EnableCommentsOverride || post.IsLocked) ? "0" : post.Replies.ToString();
Location #4
On or around line 241 of CommunityServerBlogs(20)\Controls\EntryList.cs change:
if((CurrentWeblog.EnableCommentsDefault && !entry.IsLocked) || entry.Replies > 0)
to:
if((CurrentWeblog.EnableCommentsOverride && !entry.IsLocked) || entry.Replies > 0)
Location #5
On or around line 403 of CommunityServerBlogs(20)\Controls\EntryList.cs change:
if ((CurrentWeblog.EnableCommentsDefault && !weblogPost.IsLocked) || weblogPost.Replies > 0)
to:
if ((CurrentWeblog.EnableCommentsOverride && !weblogPost.IsLocked) || weblogPost.Replies > 0)
Location #6 - This is an XML comment error only
On or around line 624 of CommunityServerComponentss(20)\Components\Post.cs change:
Whether or not this post allows replies
to:
Whether or not this post has been read by poster
Location #7
On or around line 50 of CommunityServerWeb(20)\ControlPanel\Blogs\SyndicationOptions.aspx.cs change:
if (CurrentWeblog.EnableCommentsDefault == false)
to:
if (CurrentWeblog.EnableCommentsOverride == false)
Location #8
On or around line 81 of CommunityServerWeb(20)\ControlPanel\Blogs\SyndicationOptions.aspx.cs change:
if (CurrentWeblog.EnableCommentsDefault == false)
to:
if (CurrentWeblog.EnableCommentsOverride == false)
And here is a partial list of possible locations for the second issue:
CommunityServerBlogs(20)\Components\Syndication\RssCommentHandler.cs - (47, 15) : if (!blog.EnableCommentsDefault)
CommunityServerBlogs(20)\Components\Syndication\WeblogCategoryRssWriter.cs - (41, 60) : return base.AllowComments && CurrentWeblog.EnableCommentsDefault;
CommunityServerBlogs(20)\Components\Syndication\WeblogRssWriter.cs - (63, 60) : return base.AllowComments && CurrentWeblog.EnableCommentsDefault;
CommunityServerBlogs(20)\Components\Syndication\WeblogRssWriter.cs - (80, 22) : if (CurrentWeblog.EnableCommentsDefault && CurrentWeblog.EnableRssCommentsDefault)
There may be other places as well, but these are the ones that I have found and am sure about.