Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

is there a hotfix for problem with PeopleEditor in IE-9? http://social.msdn.microsoft.com/Forums/pl-PL/sharepoint2010general/thread/90b3835c-6754-4bb6-9fd4-b74f16f236ff

Exception Details: System.InvalidOperationException: Namespace prefix 'xsd' is not defined.

Solution is

<meta http-equiv="X-UA-Compatible" content="IE=8"/>

but we want to use

<meta http-equiv="X-UA-Compatible" content="IE=9"/>
share|improve this question
2  
Unfortunately, there are more stuff that doesn't work in IE-9 mode. E.g. Save -button in modal dialogs. –  Anatoly Mironov Jan 19 '12 at 9:06
add comment

4 Answers

Alex,

This really is one of the more vexing issues of upgrading the branding/master page of a SharePoint site. Please try this solution:

I created a javascript file called entityeditor.ie9fix.js, added the javascript code that will follow, and saved it in /layouts/1033.

In my master page I added

<script type="text/javascript" src="/_layouts/1033/entityeditor.ie9fix.js"></script>

to the very BOTTOM of the master page, right before the following tags:

<input type="text" name="__spDummyText1" style="display:none;" size="1"/>
<input type="text" name="__spDummyText2" style="display:none;" size="1"/>

For some reason using the usual tricks to get it to load after the original entityeditor.js from SharePoint did not work.

Inside the custom javascript is an override of a SharePoint function and a helper function:

function ConvertEntityToSpan(ctx, entity)
{ULSGjk:;
    if(matches[ctx]==null)
        matches[ctx]=new Array();
    var key=entity.getAttribute("Key");
    var displayText=entity.getAttribute("DisplayText");
    var isResolved=entity.getAttribute("IsResolved");
    var description=entity.getAttribute("Description");
    var style='ms-entity-unresolved';
    if(isResolved=='True')
        style='ms-entity-resolved';
    var spandata="<span id='span"+STSHtmlEncode(key)+"' isContentType='true' tabindex='-1' class='"+style+"' ";
    if (browseris.ie8standard)
        spandata+="onmouseover='this.contentEditable=false;' onmouseout='this.contentEditable=true;' contentEditable='true' ";
    else
        spandata+="contentEditable='false' ";
    spandata+="title='"+STSHtmlEncode(description)+"'>"
    spandata+="<div style='display:none;' id='divEntityData' ";
    spandata+="key='"+STSHtmlEncode(key)+"' displaytext='"+STSHtmlEncode(displayText)+"' isresolved='"+STSHtmlEncode(isResolved)+"' ";
    spandata+="description='"+STSHtmlEncode(description)+"'>";
    var multipleMatches=EntityEditor_SelectSingleNode(entity, "MultipleMatches");
    matches[ctx][key]=multipleMatches;
    var extraData=EntityEditor_SelectSingleNode(entity, "ExtraData");
    if(extraData)
    {
        var data;
        if(extraData.firstChild)
            data=extraData.firstChild.xml;
        if(!data) data=extraData.innerXml || extraData.innerHTML;
        if(!data && document.implementation && document.implementation.createDocument)
        {
            var serializer=new XMLSerializer();
            data=serializer.serializeToString(extraData.firstChild);

                    // **** CUSTOM FUNCTION ****
            data = fixDataInIE9(data);
        }
        if(!data) data='';
        spandata+="<div data='"+STSHtmlEncode(data)+"'></div>";
    }
    else
    {
        spandata+="<div data=''></div>";
    }
    spandata+="</div>";
    if(PreferContentEditableDiv(ctx))
    {
        if(browseris.safari)
        {
            spandata+="<span id='content' tabindex='-1' contenteditable='false'  onmousedown='onMouseDownRw(event);' onContextMenu='onContextMenuSpnRw(event,ctx);' >";
        }
        else
        {
            spandata+="<span id='content' tabindex='-1' contenteditable onmousedown='onMouseDownRw(event);' onContextMenu='onContextMenuSpnRw(event,ctx);' >";
        }
    }
    else
    {
        spandata+="<span id='content' tabindex='-1' contenteditable onmousedown='onMouseDownRw(event);' onContextMenu='onContextMenuSpnRw(event,ctx);' >";
    }
    if (browseris.ie8standard)
        spandata+="\r";
    if(displayText !='')
        spandata+=STSHtmlEncode(displayText);
    else
        spandata+=STSHtmlEncode(key);
    if (browseris.ie8standard)
        spandata+="\r</span></span>\r";
    else
        spandata+="</span></span>";
    return spandata;
}

// **** CUSTOM FUNCTION ****
function fixDataInIE9(data)
{
    if(data.indexOf('<ArrayOfDictionaryEntry>') >= 0)
    {
        data = data.replace('<ArrayOfDictionaryEntry>', '<ArrayOfDictionaryEntry xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema-instance\">');
    }
    return data;
}

After setting that up and publishing the master page I reloaded my site and had no problems saving people from the people picker. Heck of a lot easier than trying to get everyone to use firefox, or some kind of plugin.

PS: I marked my code with // ** CUSTOM FUNCTION **

/**** UPDATED 4/25/2012 ******/

Added reference to the exact location in which to place updated entityeditor.ie9fix.js script tag. Placing the script here will allow you to create new items and edit existing ones which contain a people picker control.

share|improve this answer
    
FYI, this apparently only works when you are creating NEW list items. If you are editing existing items in which the people picker is already filled in, there seems to be more work that needs to be done. –  Matt Apr 20 '12 at 17:45
    
see update, issue resolved. –  Matt Apr 25 '12 at 20:08
1  
Thanks very much for this Matt. Came across the exact same problem on my site and your solution worked. Cheers! –  user9462 Jul 13 '12 at 13:29
    
Matt, Thank you for this great post and solution. You saved me hours of trying to debug and create a fix for this. Joe –  user10410 Aug 29 '12 at 19:02
    
Thanks, helped to solve the issue! –  Yuri Leontyev Nov 2 '12 at 14:31
show 1 more comment

This is my solution: http://blog.vitalyzhukov.ru/peopleeditorand-internet-explorer-9.aspx (in russian). Translated page by Google translator: http://translate.google.com/translate?sl=ru&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fblog.vitalyzhukov.ru%2Fpeopleeditorand-internet-explorer-9.aspx

share|improve this answer
    
Vitaly, this was extraordinarily helpful to me as I have been struggling with the same problem. I have come up with a slightly different solution, however, that I think maybe you will approve of. –  Matt Apr 17 '12 at 18:52
add comment

The answer by Miracules is correct. I edited the pickerdialog.master file just a little differently -- Here's what I added in the head:

<head runat="server">
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE8"/>
<meta http-equiv="X-UA-Compatible" content="IE=8"/>

I continued to experience problems until I added 'runat=server' to the head tag.

Hope this helps!

share|improve this answer
add comment

You've got the solution right, but the location wrong. As the People Picker is using the pickerdialog.master file, you need to add the following line in the head element.

meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"

Find the pickerdialog.master file in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS and make a backup.

Now open it and insert the line at the start of the head element.

<head> <meta name="GENERATOR" content="Microsoft SharePoint" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> .... </head>

This should solve the problem in People Picker.

Cheers

share|improve this answer
    
KCRyan: Good suggestion - I'll give it a try. (Also if you liked my suggestion, feel free to vote it up ;) –  miracules Aug 9 '13 at 8:47
add comment

protected by Community Aug 30 '12 at 7:01

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.