Landmine: Placing SiteAction control below page publishing control bar

Posted: February 25, 2010 in MOSS 2007

Recently, I ran into an issue where a client’s site was having issues while in edit mode IF they added a content editor web part and attempted to modify the content utilizing the Rich text or source editors. When they clicked OK in these editors, their page would refresh with a “The page you are attempting to save has been modified by another user since you began editing.” error. They would then have 3 scary and confusing options: 1. Preview current version, 2. Save and overwrite changes, 3. Save without changes. No matter which option they chose it seemed to be totally ignored and their changes are always saved.

This behavior is confusing to say the least. Their site is pretty heavily branded so the first thing I did was remove all the web parts 1 by one. Still the same issue. Then I tried an OOB page layout, same issue. Then I reverted back to the default.master and bam, the issue was gone. So I tried the old page layout and web parts with the default.master, no problem. So we found this was a master page issue.

Some quick googling found a couple posts which describe this was created when the site actions control was moved below the page publishing control bar. So time to ratchet the ULS log to “Please fill up my hard drive till it bleeds” mode, bust out fiddler, and do some real analysis. Found some interesting things.

First of all, when you click OK on the html or rich text editor from the content editor web part, it calls a WebPartService.asmx web service and saves your changes, then forces a full page refresh when the window closes. Every other OOB web part pushed the new content to the controls in the web part maintenance panel. Acting on a hunch I tried some CTRL+F5 and plain old F5. When the page was in edit mode even when absolutely no changes were made, this reproduced the issue the majority of times.

Second, the three options that did not appear to work, worked just fine. The page had been already saved when the user clicked OK on the editor form. No matter what option you choose you are loading the same page. By opening a second window with the same user name you can see the changes are there. Interestingly enough the page is NOT in edit mode in the second window you open. Which tends to make you think Edit mode is either tied to the session or pushed into a cache or cookie for just that browser session and client (this is important in the site action control issue).  Anyone have further info on this I would LOVE to hear it.

Third, when looking the site actions control on multiple windows, the only difference is the “Edit Page” option is in a different state (disabled vs. enabled). The ULS logs show multiple steps to actually trimming this. The XML is loaded and trimmed multiple times AFTER the publishing controls are added to the form.

My current hypothesis (still testing as time permits) is that the publishing controls detect changes between the page (the part below the publishing controls) as pulled from the DB and what is in the current active edit cache. Any changes/differences will trip the error. Now MS had counted on the difference in web parts, edit mode vs. non edit mode view, nav changes etc. but they likely never counted on, or tested the site actions control trimming.

So what we come to is this. If you can avoid it, do not put the site actions control under the publishing control. If you do, this is an issue you will have to be willing to live with. Like I said, I could not see any other repercussions but I would not be surprised if there were others that show up. Would be nice if I could get any word from MS on this but with 2010 coming out soon, I would not hold my breath.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s