In SharePoint 2010, there is a bug in the SP.UI.RTE.js file (and it’s debug version) that causes a JavaScript error in a few different situations. For myself, it was occurring when using the TaxonomyWebTaggingControl on a custom application page. Others have noticed the error with form validation.

The issue is caused by a null reference exception that isn’t caught in a try-catch block or other type of error handling.

James Boman posted a solution that involves editing these files on the hard drive. I agree with his sentiment in the post that this is a really bad idea for a few reasons: 1) Microsoft doesn’t support your environment if you mess with their files, 2) any updates to SharePoint (and sometimes Windows) will override your changes, and 3) you could do more damage than good.

With that said, however, using his modified code, we can override the offending code with some additional JavaScript rather than editing Microsoft’s code. In this function, we first ensure that the function is not undefined. Then, we replace the specific function with a fixed version of the function. It’s not the prettiest fix, however it sure beats editing Microsoft’s files.

In my project, I am loading this JavaScript on every page using an AdditionalPageHead control.

Hopefully you find this useful.

Pin It on Pinterest

Share This
%d bloggers like this: