Thursday, October 20, 2011

Fix Blog Comment bug for SharePoint 2010

SharePoint Bug:

Scenarios: Turn on anonymous access to the comment list with full functioning such as Delete/Add/Edit and View item.

Work As Design and Problem: If you logged into site by Anonymous,  of course, you can post the comment, edit and delete the comment. However, these comments which has created by Anonymous, all anonymous can view these comments although they are not approved. Especially, anonymous can be edit/delete the comment which posted by another anonymous. And then, if you logged into by authenticated account, you will not see these comment because they are not approved yet. That's so funny.

Resolve: If user log-in the site by anonymous and post the comment, item needs to be approved before showing on the page. So, after user click post comment button, they will see nothing change on the page. It's a little confuse but it should be.

More thing, although edit permission is turned on for anonymous but it should not be use in this scenarios, because no one knows who is edited and editing/deleting to be complicated. So, we must check if anonymous access and the comment has been approved, just show as normal.


Just change a little thing. Go go 14/hive and open folder Layouts/xsl, open the file blog.xsl and go to line at 418, insert the line:

<xsl:if test="($Userid &lt; 0 and $thisNode/@_ModerationStatus = 'Approved') or ($Userid &gt; 0)">
//SharePoint Code

and insert the line at 448 a close tag

</xsl:if>

See attach:

Warning: if follow this instruction, the WAD of SharePoint default will not keep correctly, this is also new view for end user and I think it should be change like this and make sense for all cases.

1 comment:

Anonymous said...

Interesting article as for me. Thanks for posting that data.

Jerry Octocus
mobile phone jammer