Tuesday, October 21, 2014

Strange Error in IE Developer window "Unable to get property 'showWaitScreenWithNoClose'" when changing Page Layout in SharePoint 2013 / SharePoint Online

I encountered a very strange error on Office 365 SharePoint Online where the ability to change the Page Layout suddenly stopped working (Page Layout button was still enabled though but none of the Page Layouts were clickable).

Basically when I debugged the error using IE Developer toolbar, I saw that the error was being thrown within sp.ui.runtime.js file each time I was trying to change the Page Layout - namely "Unable to get property 'showWaitScreenWithNoClose'" and also the SP.UI.ModalDialog box was null.

Eventually I traced the error back to the order of key js files that should be included/loaded on the default master page for the site. In my case the culprit were two script references:

<script src="../../_layouts/15/SP.Runtime.js" type="text/javascript">//<![CDATA[

<script src="../../_layouts/15/SP.js" type="text/javascript">//<![CDATA[

I changed the above lines in the default master page to:

<!--SPM:<Sharepoint:ScriptLink runat="server" Name="SP.js" Localizable="false"  ID="s1" LoadAfterUI="true"/>-->

<!--SPM:<Sharepoint:ScriptLink runat="server" Name="SP.Runtime.js" Localizable="false"  ID="s2" LoadAfterUI="true"/>-->
The key thing to note is the "LoadAfterUI" attribute that seemed to do the trick,
Now my page layouts are selectable and I can click and change the Page Layout to one the available layout pages in my site collection (Note - ensure that the page is in Edit mode for you to change the Layout Page)

Friday, September 26, 2014

/_layouts/15/osssearchresults.aspx not returning any search results when Searching "This Site"

I have commonly observed this issue being researched on a few times where a user selects "This Site" from Search scope/nvaigation dropdown and tries to search for a specific content in the current site, the "No results found" message is displayed. The proble is not with crawling or Search configuration but is with "Alternate Access Mappings" (AAM).

To fix the above issue and see results when searching "This Site" ensure that you have set the URL  for default zone same as URL that you are using to access the site using your browser. For example if you are using https://intranet.mycompany.com as URL to access your Intranet using a browser then ensure that the above URL is set in Alternate access mapping as your Default Zone (refer to <your SharePoint central admin URL>/_admin/EditOutboundUrls.aspx)