Thursday, May 24, 2012

CA, Web app, Generel Settings, Updates are currently disallowed on GET requests

When we select (in Central Administration) Web Applications -> General Settings for a few of our web applications, we get this error message:

“Error Updates are currently disallowed on GET requests.  To allow updates on a GET, set the ‘AllowUnsafeUpdates’ property on SPWeb. Troubleshoot issues with Microsoft SharePoint Foundation”
 
The behavior was that new web applications would throw the error ‘Updates are currently disallowed on GET requests’ when we went to ‘General Settings’ in CA.  Since creating webapps isn’t an everyday occurrence in our environment, we aren’t sure the exact cause, but being a dev environment it could be a number of things.
 
Below mentioned powershell fixed it:
$w = get-spwebapplication
http://nameofproblemwebapp
$w.HttpThrottleSettings
$w.Update()

Page Layout and Text Layout Buttons Disabled on Ribbon

I was having trouble adding and changing content due to both the Page Layout and Text Layout buttons were disabled in the custom master page. It was working fine with default v4 master page. There are lot of possible reason for this issues. You can check the link mentioned below:
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/dfb9a2ab-3dc7-4171-a35d-6eaffce97b72
Any of the solutions mentioned in the above link did not worked for me. After comparing my custom master page I figured out that one of the default javascript was missing which executes on load of the page.
I changed  <body> to  <body onload=”javascript:_spBodyOnLoadWrapper();”> and the editing tools control started working fine.
Basically the javascript _spbodyOnLoadWrapper() was missing in my master page.

Hide Multiple Upload link in SharePoint 2010

I wanted to hide “Upload multiple Files..” link from the document upload page. There are various solutions for acheiving the same. All of the possible solutions are mentioned in the link below:
http://salaudeen.blogspot.in/2010/12/disable-multiple-file-upload-in.html
I added the below mentioned script in my CSS file (custom CSS file used of my master page). This will hide “Upload Multiple Files..” for all documents libraries for which this CSS is applied.

#ctl00_PlaceHolderMain_UploadDocumentSection_ctl03_UploadMultipleLink, #Ribbon\.Documents\.New\.AddDocument\.Menu\.Upload\.UploadMultiple-Menu32
{
         display: none; 
}