Error: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

The Content Editor Web Part occasionally gives me this error when it contains HTML source and it doesn't like something in the HTML source after it has parsed (changed) the HTML source. Once this happens, the page is uneditable and the problem is not able to be easily rectified.

Exact steps to reproduce would be:

  1. Add a Content Editor Web Part.
  2. Insert some simple HTML source with an embedded <span style="color:blue">TEST</span> in there.
  3. Save and approve the page.
  4. Edit the page.
  5. Attempt to edit the web part. You will receive a JavaScript error stating that "style.display is null or not an object".
  6. Attempt to delete the web part. You will receive the following error below.

Server Error in '/' Application.
--

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

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.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

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:

[FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).]
System.Guid..ctor(String g) +2957
Microsoft.SharePoint.WebPartPages.SPWebPartManager.ApplyChangeList(String changeString) +1237
Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnLoad(EventArgs e) +712
System.Web.UI.Control.LoadRecursive() +101
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2588

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

[2573 byte] By [HectorMike] at [2008-1-10]
# 1

I found the exact reason for this. In some cases there was an embedded <div> tag inside the <div> tag that the Content Editor web part renders. This div tag was previously rendered by another Content Editor web part and was cut & pasted into the rich text editor of the new web part. In other words, the rendered content of one web part was used as a basis for the new web part by selecting the HTML in the browser, copying it to the clipboard, and pasting it into the rich text editor of the new web part for editing. In doing so, the old web part's rendered <div> tag was nested into the new web part's rendered div tag, but wasn't apparent until I inspected the HTML closely that was in the rich text editor. I had to delete and re-create any page where this occurred, since there is no way to edit the compromised web part or delete it.

HectorMike at 2007-10-3 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Design and Customization...
# 2

Dudes. This is a serious problem.

You CAN delete the rampant webpart though. Append ?contents=1 to your URL and it will take you to webpart maintenance view of that page that shows you all of the webparts that are opened or closed and if they are causing an error. Select the webpart that you suspect is bad and click the delete button. No more re-creating pages.

PJ

PJ-Winona at 2007-10-3 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Design and Customization...
# 3
Thanks, PJ. I will give it a try!
HectorMike at 2007-10-3 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Design and Customization...

SharePoint Products and Technologies

Site Classified