Bill Robertson's Blog

CS 2.1 RTM Content Part Bug Fix

The Community Server 2.1 RTM release had a bug in the Content Part editor.  The first time you edited a content part, it would mistakenly inject excess html code into the body of the text you entered.  This would prevent a user from making another change.

Soon there will be a CS 2.1 Service Pack released to handle this issue.  You can wait for the service pack release, although I don't know when it will be released. 

You can edit the code directly.  Follow the directions on this post.  http://communityserver.org/forums/permalink/542732/549813/ShowThread.aspx#549813

From Ben Tiedt:

If you'd like to implement the fix for this issue before the service pack is released (and you're comfortable editing/compiling source code), you can edit the Controls/Utility/EditContent.cs file and replace the "else if" and related code block on line 81 with the following:

else if (!Globals.IsNullorEmpty(Page.Request.QueryString["clientid"]))
    {
     StringBuilder script = new StringBuilder();
     script.AppendFormat("<input type=\"hidden\" name=\"{0}_ParentContent\" id=\"{0}_ParentContent\" />", this.ClientID);
     script.Append("<script language=\"javascript\" type=\"text/javascript\">");
     script.Append("try { if (window.parent && window.parent.Telligent_Modal) { ");
     script.AppendFormat("var pContent = window.parent.document.getElementById('{0}').childNodes[0].childNodes[0]; ", JavaScript.Encode(Page.Request.QueryString["clientID"]));
     script.Append("if (pContent && pContent.innerHTML) { ");
     script.AppendFormat("document.getElementById('{0}_ParentContent').value = pContent.innerHTML;", this.ClientID);
     script.Append(Page.GetPostBackClientEvent(this, "reloadContent"));
     script.Append(" } } } catch (e) {} </script>");

     Page.RegisterStartupScript(this.ClientID + "_ReloadContent", script.ToString());
    }

Or you can download the CommunityServer.Controls.dll I built with these changes.  I took the CS 2.1 RTM, changed the code and recompiled.  You can download it here.

Comments

Community Server Daily News said:

news of the day a grab bag for what's happening in Community Server The San Francisco MeetUp on the night

# October 12, 2006 2:15 PM

steveso said:

Thank you, thank you, thank you!

Steve

# October 12, 2006 11:40 PM

Daily News Faq List said:

Bill Robertson with everything you need to fix the CS 2.1 Content Part bug.

# November 22, 2006 10:07 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)