Error: JSON is undefined. Infopath Form People Picker in SharePoint 2013

Sathish Nadarajan
 
Solution Architect
February 26, 2016
 
Rate this article
 
Views
9879

Recently our customers were upgraded from their IE10 to IE11 on the entire Stakeholders machine. At that time, we faced a strange exception with the InfoPath Forms. We had some People Picker in the Infopath Form. But, when trying to click on the People Picker, we got an exception like “Json is undefined”.

After some analysis, we found that, this is a known defect with the Microsoft and it is being fixed on the subsequent Knowledge Bases. http://support.microsoft.com/en-us/kb/2880473 But even, then there are many information revolving around this error like, whether this is fixed on the April CU or March CU etc., We don’t want to take any assumptions as this is been an existing system.

Hence, we wanted to fix this by the coding level. Actually the fix was very simple, but it requires an update on the Layouts File. (Which many customers may hesitate, but there is no harm in it)

Open the PeopleDialog.master from the Layouts Folder.

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS

1. Add the DocType at the top of the File.<!DOCTYPE html>

2. Update the Line <meta http-equiv="X-UA-Compatible" content="IE=10"/> with <meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1" />

The Updated file looks like below. The same can be copied and pasted.

 <!DOCTYPE html>
 
 <%@ Assembly Name="Microsoft.SharePoint.ApplicationPages"  %>
 <%@Master language="C#" Inherits="Microsoft.SharePoint.ApplicationPages.PickerDialogMaster"%>
 <%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 <%@ Register TagPrefix="wssuc" TagName="LinksTable" src="/_controltemplates/15/LinksTable.ascx" %> <%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="/_controltemplates/15/InputFormSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="/_controltemplates/15/InputFormControl.ascx" %> <%@ Register TagPrefix="wssuc" TagName="LinkSection" src="/_controltemplates/15/LinkSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="/_controltemplates/15/ButtonSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ActionBar" src="/_controltemplates/15/ActionBar.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ToolBar" src="/_controltemplates/15/ToolBar.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="/_controltemplates/15/ToolBarButton.ascx" %> <%@ Register TagPrefix="wssuc" TagName="Welcome" src="/_controltemplates/15/Welcome.ascx" %>
 <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 <html lang="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,language_value%>' EncodeMethod='HtmlEncode'/>" dir= "<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,multipages_direction_dir_value%>' EncodeMethod='HtmlEncode'/>" >
 <head runat="server">
 	<meta name="GENERATOR" content="Microsoft SharePoint" />
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<meta http-equiv="Expires" content="0" />
 	<meta http-equiv="Pragma" content="no-cache" />
 	<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1" />
  
 	<title id="onetidTitle"><asp:ContentPlaceHolder id="PlaceHolderDialogHeaderPageTitle" runat="server"/></title>
 	<SharePoint:CssLink runat="server"/>
 	<SharePoint:CssRegistration name="corev4.css" runat="server" />
 	<SharePoint:Theme runat="server"/>
 	<SharePoint:ScriptLink language="javascript" name="core.js" localizable="false" runat="server" />
 		<SharePoint:ScriptBlock runat="server">
 			function showWaitCursor(fIsOK)
 			{
 				if(document.all)
 				{
 					for (var i=0; i<document.all.length; i++)
 					{
 						document.all(i).style.cursor="wait";
 					}
 					return true;
 				}
 			}
 			function checkForEsc(e)
 			{
 				if(!e)	e = window.event;
 				var key = e.keyCode;
 				if(key==27)
 					doCancel();
 			}
 			function disableOK()
 			{
 			    <% if (btnOk != null) { %>
 					var ok=(document.getElementById("<%= btnOk.ClientID %>"));
 					ok.disabled=true;
 				<% } %>
 			}
 			function enableOK()
 			{
 			    <% if (btnOk != null) { %>
 					var ok=(document.getElementById("<%= btnOk.ClientID %>"));
 					ok.disabled=false;
 				<% } %>
 			}
 			function doCancel()
 			{
 				window.parent.close();
 			}
 			function doClickOK()
 			{
 			    <% if (btnOk != null) { %>
 					var ok=(document.getElementById("<%= btnOk.ClientID %>"));
 					ok.click();
 				<% } %>
 			}
 			function setSize()
 			{
 				var tbl=document.getElementById('mainTable');
 				if(tbl==null || tbl.offsetWidth<300)
 				{
 					window.parent.w=525;
 				}
 				else
 				{
 					window.parent.w=tbl.offsetWidth;
 					window.parent.h=tbl.offsetHeight;
 				}
 			}
 		</SharePoint:ScriptBlock>
 		<base target="_self"/>
 	<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
 </head>
 <SharePoint:ScriptBlock runat="server">
 var loaded=false;
 </SharePoint:ScriptBlock>
 <body onload="javascript:_spBodyOnLoadWrapper(); try { if(parent)parent.document.title=document.title;setSize();loaded=true; } catch (e) {}" onkeypress="checkForEsc(event);">
 <form runat="server" method="post" onsubmit="if (typeof(_spFormOnSubmitWrapper) != 'undefined') {return _spFormOnSubmitWrapper();} else {return true;}">
 	<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />
 <SharePoint:FormDigest runat=server/>
 <table class="ms-main" cellpadding="0" cellspacing="0" border="0" width="100%" height="100%" id="mainTable">
 <!-- Dialog title section begins -->
 <asp:ContentPlaceHolder id="PlaceHolderDialogTitleSection" runat="server">
 <tr>
 	<td colspan="2">
 		<table border="0" cellpadding="0" cellspacing="0" width="100%">
 			<tr style="padding-bottom: 4px;">
 				<td width="15px"> </td>
 				<td	width="0">
 					<asp:ContentPlaceHolder id="PlaceHolderDialogImage" runat="server">
 						<img id="onetidtpweb1" src="/_layouts/15/images/settings.gif?rev=23" alt="" height="49" width="49"/>
 					</asp:ContentPlaceHolder>
 				</td>
 				<td	valign="top" width="100%">
 					<table	width="100%" cellspacing="0" cellpadding="0">
 						<tr>
 							<td class="ms-titlearea	ms-pageidta">
 								<asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">
 									<SharePoint:ProjectProperty Property="Title" runat="server"/>
 								</asp:ContentPlaceHolder >
 							</td>
 						</tr>
 						<tr>
 							<td	class="ms-pagetitle ms-pageidpt" valign="bottom">
 								<asp:ContentPlaceHolder id="PlaceHolderDialogTitleInTitleArea" runat="server">
 								</asp:ContentPlaceHolder>
 							</td>
 						</tr>
 					</table>
 				</td>
 				<td class="ms-nav"  align="right" valign="bottom" width="0" nowrap="nowrap">
 					<asp:ContentPlaceHolder id="PlaceHolderHelpLink" runat="server">
 						<a href='javascript:HelpWindowKey("<% = HelpKey %>")'><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,multipages_helplink_text%>" EncodeMethod='HtmlEncode'/></a>
 					</asp:ContentPlaceHolder >
 				</td>
 			</tr>
 			<tr>
 				<td	height="4"></td>
 			</tr>
 			<tr>
 				<td class="ms-sectionline" colspan="3" height="2"><img src="/_layouts/15/images/blank.gif?rev=23" width='1' height='1' alt="" /></td>
 			</tr>
 			<tr>
 				<td colspan="3" class="ms-descriptiontext"	style="padding-top: 8px; padding-bottom: 12px;">
 					<asp:ContentPlaceHolder id="PlaceHolderTitleDescription" runat="server">
 					</asp:ContentPlaceHolder>
 				</td>
 			</tr>
 		</table>
 	</td>
 </tr>
 </asp:ContentPlaceHolder>
 <!-- Dialog	title section ends -->
 <!-- Dialog Body Section Begins -->
 <tr height="100%">
 	<td width="100%" height="100%"><asp:ContentPlaceHolder id="PlaceHolderDialogBodySection" runat="server"/></td>
 </tr>
 <!-- Dialog Body Section Ends -->
 <!-- Dialog Button Section Begins -->
 <tr>
 	<td width="100%">
 	    <asp:ContentPlaceHolder id="PlaceHolderDialogButtonSection" runat="server">
 		<table id='Buttons' cellspacing="0" cellpadding="0" width="100%" border="0">
 			<tr height="10"><td colspan="4"></td></tr>
 			<tr>
 				<td width="100%" colspan="4">
 					<asp:ContentPlaceHolder id="PlaceHolderDialogPrebuttonSection" runat="server"/>
 				</td>
 			</tr>
 			<tr>
 				<td width="100%"><img src="/_layouts/15/images/blank.gif?rev=23" width='1' height='1' alt="" /></td>
 				<td> </td>
 				<td nowrap="nowrap">
 				    <asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" OnClick="BtnOk_Click" Text="<%$Resources:wss,multipages_okbutton_text%>" id="btnOk" accesskey="<%$Resources:wss,okbutton_accesskey%>"/>
 				    <span id="idSpace" class="ms-SpaceBetButtons"></span>
 					<input type="button" id="BtnCancel" class="ms-ButtonHeightWidth" value="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,multipages_cancelbutton_text%>' EncodeMethod='HtmlEncode'/>" onclick="if (window.frameElement) { window.frameElement.cancelPopUp(); return false; } else { doCancel(); }" accesskey="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,cancelbutton_accesskey%>' EncodeMethod='HtmlEncode'/>"/>
 				</td>
 				<td width="15px"><img src="/_layouts/15/images/blank.gif?rev=23" width='15' height='1' alt="" /></td>
 			</tr>
 			<tr height="10"><td colspan="4"></td></tr>
 		</table>
 		</asp:ContentPlaceHolder>
 	</td>
 </tr>
 <!-- Dialog Button Section Ends -->
 </table>
 </form>
 </body>
 </html>
 

Happy Coding,

Sathish Nadarajan.

Category : Infopath, SharePoint

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

Leave a comment